Skip to content

Segmentation fault (access null pointer) in ext/date/lib/parse_tz.c #15582

Closed
@YuanchengJiang

Description

@YuanchengJiang

Description

The following code:

<?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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions