summaryrefslogtreecommitdiff
path: root/ext/phar/tests
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2020-07-14 17:04:24 +0200
committerStanislav Malyshev <stas@php.net>2020-08-03 01:10:22 -0700
commit775385df0e954f8cf9b5046bebc8e40ce26e601b (patch)
tree14dd8dfd6fd21aeda0b7676cf103d802a668375a /ext/phar/tests
parent24495ba7780b0656a753678c6337d7a479d35ed3 (diff)
downloadphp-git-775385df0e954f8cf9b5046bebc8e40ce26e601b.tar.gz
Fix #79797: Use of freed hash key in the phar_parse_zipfile function
We must not use heap memory after we freed it.
Diffstat (limited to 'ext/phar/tests')
-rw-r--r--ext/phar/tests/bug79797.pharbin0 -> 274 bytes
-rw-r--r--ext/phar/tests/bug79797.phpt14
2 files changed, 14 insertions, 0 deletions
diff --git a/ext/phar/tests/bug79797.phar b/ext/phar/tests/bug79797.phar
new file mode 100644
index 0000000000..21d43d9eeb
--- /dev/null
+++ b/ext/phar/tests/bug79797.phar
Binary files differ
diff --git a/ext/phar/tests/bug79797.phpt b/ext/phar/tests/bug79797.phpt
new file mode 100644
index 0000000000..761e5379e0
--- /dev/null
+++ b/ext/phar/tests/bug79797.phpt
@@ -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