]> granicus.if.org Git - php/commitdiff
Fixed bug #71561 (NULL pointer dereference in Zip::ExtractTo)
authorXinchen Hui <laruence@gmail.com>
Tue, 9 Feb 2016 15:32:20 +0000 (23:32 +0800)
committerXinchen Hui <laruence@gmail.com>
Tue, 9 Feb 2016 15:32:20 +0000 (23:32 +0800)
NEWS
ext/zip/php_zip.c

diff --git a/NEWS b/NEWS
index 0fc0565798ee0d8f4f77eb982df48089adc38a96..a13c4b2d54f50c19740cd5edf551de909bcc6308 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,9 @@ PHP                                                                        NEWS
 - Standard:
   . Fixed bug #70720 (strip_tags improper php code parsing). (Julien)
 
+- Zip:
+  . Fixed bug #71561 (NULL pointer dereference in Zip::ExtractTo). (Laruence)
+
 04 Feb 2016, PHP 5.6.18
 
 - Core:
index d040d206d1a9ea6ebaaa007ad186da532d8ba024..ccd0467fd353f0f5c2d8834a51ab217aa6053e0d 100644 (file)
@@ -2713,7 +2713,7 @@ static ZIPARCHIVE_METHOD(extractTo)
 
                for (i = 0; i < filecount; i++) {
                        char *file = (char*)zip_get_name(intern, i, ZIP_FL_UNCHANGED);
-                       if (!php_zip_extract_file(intern, pathto, file, strlen(file) TSRMLS_CC)) {
+                       if (!file || !php_zip_extract_file(intern, pathto, file, strlen(file) TSRMLS_CC)) {
                                        RETURN_FALSE;
                        }
                }