[php-src] Issue #15582: Segmentation fault (access null pointer) in ext/date/lib/parse_tz.c

From: Date: Sun, 25 Aug 2024 11:59:44 +0000
Subject: [php-src] Issue #15582: Segmentation fault (access null pointer) in ext/date/lib/parse_tz.c
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-247589@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/15582 Author: YuanchengJiang ### Description The following code: ```php <?php class MyDateTimeZone extends DateTimeZone { function __construct() { } } $mdtz = new MyDateTimeZone(); $fusion = $mdtz; $d[] = date_create("2005-07-14 22:30:41", $fusion); foreach($d as $date) { echo $date->format(DateTime::ISO8601), "\n"; } ``` Resulted in this output: ``` /php-src/ext/date/lib/parse_tz.c:800:11: runtime error: member access within null pointer of type 'timelib_tzinfo' (aka 'struct _timelib_tzinfo') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /php-src/ext/date/lib/parse_tz.c:800:11 ``` ### PHP Version PHP 8.4.0-dev ### Operating System ubuntu 22.04

« previous php.bugs (#247589) next »