summaryrefslogtreecommitdiff
path: root/ext/zip/zip_stream.c
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2017-07-11 11:41:47 +0200
committerRemi Collet <remi@php.net>2017-07-11 11:41:47 +0200
commit2458dce3e5bff026e91e42f292ca7bc0e2b2731c (patch)
tree1bbd4f56c42a26797cdabc02336caf66ec9fd09e /ext/zip/zip_stream.c
parentc620daecb4f8b1552eb3f63f6a699ea315825072 (diff)
downloadphp-git-2458dce3e5bff026e91e42f292ca7bc0e2b2731c.tar.gz
Fix segfault in php_stream_context_get_option call
Diffstat (limited to 'ext/zip/zip_stream.c')
-rw-r--r--ext/zip/zip_stream.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/zip/zip_stream.c b/ext/zip/zip_stream.c
index 8e7dbcf769..fca18540b1 100644
--- a/ext/zip/zip_stream.c
+++ b/ext/zip/zip_stream.c
@@ -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");
}