1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00

Merge branch 'PHP-8.4' into PHP-8.5

* PHP-8.4:
  Fix crash in property existence test in ext/zip
This commit is contained in:
Niels Dossche
2025-11-16 21:29:16 +01:00
3 changed files with 24 additions and 2 deletions

3
NEWS
View File

@@ -39,6 +39,9 @@ PHP NEWS
. Fixed bug GH-20439 (xml_set_default_handler() does not properly handle
special characters in attributes when passing data to callback). (ndossche)
- Zip:
. Fix crash in property existence test. (ndossche)
13 Nov 2025, PHP 8.5.0RC5
- Core:

View File

@@ -934,9 +934,8 @@ static int php_zip_has_property(zend_object *object, zend_string *name, int type
} else if (type == 0) {
retval = (Z_TYPE(tmp) != IS_NULL);
}
zval_ptr_dtor(&tmp);
}
zval_ptr_dtor(&tmp);
} else {
retval = zend_std_has_property(object, name, type, cache_slot);
}

View File

@@ -0,0 +1,20 @@
--TEST--
Property existence test can cause a crash
--EXTENSIONS--
zip
--FILE--
<?php
$archive = new ZipArchive(__DIR__.'/property_existence.zip');
var_dump(array_column([$archive], 'lastId'));
?>
--CLEAN--
<?php
@unlink(__DIR__.'/property_existence.zip');
?>
--EXPECT--
array(1) {
[0]=>
int(-1)
}