mirror of
https://github.com/php/php-src.git
synced 2024-11-24 10:24:11 +08:00
Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd)
This commit is contained in:
parent
da3995852e
commit
ad96a052d9
4
NEWS
4
NEWS
@ -96,6 +96,10 @@ PHP NEWS
|
||||
- Wddx:
|
||||
. Fixed bug #72564 (boolean always deserialized as "true") (Remi)
|
||||
|
||||
- Zip:
|
||||
. Fixed bug #72660 (NULL Pointer dereference in zend_virtual_cwd).
|
||||
(Laruence)
|
||||
|
||||
21 Jul 2016 PHP 7.0.9
|
||||
|
||||
- Core:
|
||||
|
@ -1619,10 +1619,10 @@ static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /*
|
||||
{
|
||||
struct zip *intern;
|
||||
zval *self = getThis();
|
||||
char *path = NULL;
|
||||
char *path = ".";
|
||||
char *remove_path = NULL;
|
||||
char *add_path = NULL;
|
||||
size_t add_path_len, remove_path_len = 0, path_len = 0;
|
||||
size_t add_path_len, remove_path_len = 0, path_len = 1;
|
||||
zend_long remove_all_path = 0;
|
||||
zend_long flags = 0;
|
||||
zval *options = NULL;
|
||||
|
20
ext/zip/tests/bug72660.phpt
Normal file
20
ext/zip/tests/bug72660.phpt
Normal file
@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
Bug #72660 (NULL Pointer dereference in zend_virtual_cwd)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
if(!extension_loaded('zip')) die('skip');
|
||||
if(PHP_ZTS == 0) { die('skip ZTS required'); }
|
||||
?>
|
||||
--FILE--
|
||||
<?php
|
||||
$zip = new ZipArchive();
|
||||
$zip->open(dirname(__FILE__) . "/bug72660.zip", ZIPARCHIVE::CREATE);
|
||||
$zip->addPattern("/noexists/");
|
||||
?>
|
||||
okey
|
||||
--CLEAN--
|
||||
<?php
|
||||
@unlink(dirname(__FILE__) . "/bug72660.zip");
|
||||
?>
|
||||
--EXPECT--
|
||||
okey
|
Loading…
Reference in New Issue
Block a user