Skip to content

Commit 4f4ce4f

Browse files
committed
Merge remote-tracking branch 'derickr/ossfuzz-56931' into PHP-8.2
2 parents b1a49ff + ce5f75f commit 4f4ce4f

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

ext/date/php_date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ PHPAPI timelib_tzinfo *get_timezone_info(void)
568568

569569
static void update_property(zend_object *object, zend_string *key, zval *prop_val)
570570
{
571-
if (ZSTR_VAL(key)[0] == '\0') { // not public
571+
if (ZSTR_LEN(key) > 0 && ZSTR_VAL(key)[0] == '\0') { // not public
572572
const char *class_name, *prop_name;
573573
size_t prop_name_len;
574574

ext/date/tests/ossfuzz-56931.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
|O:12:"DateInterval":1:{s:0:"";s:2:" ";

ext/date/tests/unserialize-test.phpt

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ $files = [
66
'ossfuzz-55589.txt',
77
'ossfuzz-55599.txt',
88
'ossfuzz-55727.txt',
9+
'ossfuzz-56931.txt',
910
];
1011

1112
foreach ($files as $file) {
@@ -24,16 +25,23 @@ foreach ($files as $file) {
2425
?>
2526
--EXPECTF--
2627
ossfuzz-55589.txt:
27-
%s: unserialize(): Error at offset 39 of 39 bytes in %sunserialize-test.php on line 14
28+
%s: unserialize(): Error at offset 39 of 39 bytes in %sunserialize-test.php on line %d
2829
bool(false)
2930

3031

3132
ossfuzz-55599.txt:
32-
%s: unserialize(): Error at offset 26 of 26 bytes in %sunserialize-test.php on line 14
33+
%s: unserialize(): Error at offset 26 of 26 bytes in %sunserialize-test.php on line %d
3334
Error: Invalid serialization data for DateTime object
3435
bool(false)
3536

3637

3738
ossfuzz-55727.txt:
38-
%s: unserialize(): Error at offset 230 of 509 bytes in %sunserialize-test.php on line 14
39+
%s: unserialize(): Error at offset 230 of 509 bytes in %sunserialize-test.php on line %d
40+
bool(false)
41+
42+
43+
ossfuzz-56931.txt:
44+
Notice: unserialize(): Error at offset 39 of 39 bytes in %sunserialize-test.php on line %d
45+
46+
Deprecated: Creation of dynamic property DateInterval::$ is deprecated in %s on line %d
3947
bool(false)

0 commit comments

Comments
 (0)