]> granicus.if.org Git - php/commitdiff
Fix segfault in php_stream_context_get_option call
authorRemi Collet <remi@php.net>
Tue, 11 Jul 2017 09:41:47 +0000 (11:41 +0200)
committerRemi Collet <remi@php.net>
Tue, 11 Jul 2017 09:41:47 +0000 (11:41 +0200)
NEWS
ext/zip/php_zip.h
ext/zip/zip_stream.c

diff --git a/NEWS b/NEWS
index 7f3bbec8527f9acf7d6c2da95ad68b0b7ad95e43..a14fd438a780432b264d8cbfd27047f8216f6112 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -54,6 +54,7 @@ PHP                                                                        NEWS
 
 - ZIP:
   . ZipArchive implements countable, added ZipArchive::count() method. (Remi)
+  . Fix segfault in php_stream_context_get_option call. (Remi)
 
 06 Jul 2017, PHP 7.2.0alpha3
 
index d874c8f691c2f2a693e388e9d155ec3fbdef5312..585309789ee862d651a0290a84382ac2f7ceb04c 100644 (file)
@@ -37,7 +37,7 @@ extern zend_module_entry zip_module_entry;
 #define ZIP_OVERWRITE ZIP_TRUNCATE
 #endif
 
-#define PHP_ZIP_VERSION "1.15.0"
+#define PHP_ZIP_VERSION "1.15.1"
 
 #define ZIP_OPENBASEDIR_CHECKPATH(filename) php_check_open_basedir(filename)
 
index 8e7dbcf769d767e0f815a093e23fffb8541a1923..fca18540b12c4f140d6432c577e1c31bf0ebe08d 100644 (file)
@@ -314,7 +314,7 @@ php_stream *php_stream_zip_opener(php_stream_wrapper *wrapper,
        if (za) {
                zval *tmpzval;
 
-               if (NULL != (tmpzval = php_stream_context_get_option(context, "zip", "password"))) {
+               if (context && NULL != (tmpzval = php_stream_context_get_option(context, "zip", "password"))) {
                        if (Z_TYPE_P(tmpzval) != IS_STRING || zip_set_default_password(za, Z_STRVAL_P(tmpzval))) {
                                php_error_docref(NULL, E_WARNING, "Can't set zip password");
                        }