Skip to content

Commit a4e3969

Browse files
author
Ilia Alshanetsky
committed
Fixed bug #43377 (PHP crashes with invalid argument for DateTimeZone)
1 parent 87dfd00 commit a4e3969

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

ext/date/php_date.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2066,6 +2066,8 @@ PHP_METHOD(DateTimeZone, __construct)
20662066
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &tz, &tz_len)) {
20672067
if (SUCCESS == timezone_initialize(&tzi, tz TSRMLS_CC)) {
20682068
((php_timezone_obj *) zend_object_store_get_object(getThis() TSRMLS_CC))->tz = tzi;
2069+
} else {
2070+
ZVAL_NULL(getThis());
20692071
}
20702072
}
20712073
php_set_error_handling(EH_NORMAL, NULL TSRMLS_CC);

0 commit comments

Comments
 (0)