mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix #79797: Use of freed hash key in the phar_parse_zipfile function
We must not use heap memory after we freed it.
This commit is contained in:
parent
24495ba778
commit
775385df0e
3 changed files with 15 additions and 1 deletions
BIN
ext/phar/tests/bug79797.phar
Normal file
BIN
ext/phar/tests/bug79797.phar
Normal file
Binary file not shown.
14
ext/phar/tests/bug79797.phpt
Normal file
14
ext/phar/tests/bug79797.phpt
Normal file
|
@ -0,0 +1,14 @@
|
|||
--TEST--
|
||||
Bug #79797 (Use of freed hash key in the phar_parse_zipfile function)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if (!extension_loaded('phar')) die('skip phar extension not available');
|
||||
?>
|
||||
--INI--
|
||||
phar.cache_list={PWD}/bug79797.phar
|
||||
--FILE--
|
||||
<?php
|
||||
echo "done\n";
|
||||
?>
|
||||
--EXPECT--
|
||||
done
|
|
@ -712,7 +712,7 @@ foundit:
|
|||
efree(actual_alias);
|
||||
}
|
||||
|
||||
zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), actual_alias, mydata->alias_len, mydata);
|
||||
zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), mydata->alias, mydata->alias_len, mydata);
|
||||
} else {
|
||||
phar_archive_data *fd_ptr;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue