mirror of
https://github.com/php/php-src.git
synced 2026-04-29 03:03:26 +02:00
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix #79922: Crash after multiple calls to xml_parser_free()
This commit is contained in:
@@ -29,6 +29,9 @@ PHP NEWS
|
||||
. Fixed bug #79930 (array_merge_recursive() crashes when called with array
|
||||
with single reference). (Nikita)
|
||||
|
||||
- XML:
|
||||
. Fixed bug #79922 (Crash after multiple calls to xml_parser_free()). (cmb)
|
||||
|
||||
06 Aug 2020, PHP 7.4.9
|
||||
|
||||
- Apache:
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
Bug #79922 (Crash after multiple calls to xml_parser_free())
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('xml')) die('skip xml extension not available');
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$c=xml_parser_create_ns();
|
||||
$a=xml_parser_free($c);
|
||||
$a=xml_parser_free($c);
|
||||
$c=0;
|
||||
var_dump($a);
|
||||
?>
|
||||
--EXPECTF--
|
||||
Warning: xml_parser_free(): supplied resource is not a valid XML Parser resource in %s on line %d
|
||||
bool(false)
|
||||
+2
-2
@@ -1157,7 +1157,7 @@ static void php_xml_parser_create_impl(INTERNAL_FUNCTION_PARAMETERS, int ns_supp
|
||||
XML_SetUserData(parser->parser, parser);
|
||||
|
||||
RETVAL_RES(zend_register_resource(parser, le_xml_parser));
|
||||
ZVAL_COPY(&parser->index, return_value);
|
||||
ZVAL_COPY_VALUE(&parser->index, return_value);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@@ -1589,7 +1589,7 @@ PHP_FUNCTION(xml_parser_free)
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
if (zend_list_delete(Z_RES(parser->index)) == FAILURE) {
|
||||
if (zend_list_close(Z_RES(parser->index)) == FAILURE) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user