Skip to content

Commit 6fab1ca

Browse files
committed
Fixed bug #65564 stack-buffer-overflow in DateTimeZone stuff caught by AddressSanitizer
1 parent a5749eb commit 6fab1ca

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ PHP NEWS
2525
- Datetime:
2626
. Fixed bug #65554 (createFromFormat broken when weekday name is followed
2727
by some delimiters). (Valentin Logvinskiy, Stas).
28+
. Fixed bug #65564 (stack-buffer-overflow in DateTimeZone stuff caught
29+
by AddressSanitizer). (Remi).
2830

2931
- OPCache:
3032
. Fixed bug #65561 (Zend Opcache on Solaris 11 x86 needs ZEND_MM_ALIGNMENT=4).

ext/date/php_date.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2305,7 +2305,7 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC)
23052305

23062306
MAKE_STD_ZVAL(zv);
23072307
ZVAL_LONG(zv, tzobj->type);
2308-
zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zval), NULL);
2308+
zend_hash_update(props, "timezone_type", 14, &zv, sizeof(zv), NULL);
23092309

23102310
MAKE_STD_ZVAL(zv);
23112311
switch (tzobj->type) {
@@ -2327,7 +2327,7 @@ static HashTable *date_object_get_properties_timezone(zval *object TSRMLS_DC)
23272327
ZVAL_STRING(zv, tzobj->tzi.z.abbr, 1);
23282328
break;
23292329
}
2330-
zend_hash_update(props, "timezone", 9, &zv, sizeof(zval), NULL);
2330+
zend_hash_update(props, "timezone", 9, &zv, sizeof(zv), NULL);
23312331

23322332
return props;
23332333
}

0 commit comments

Comments
 (0)