summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Weinand <bobwei9@hotmail.com>2017-03-14 22:15:41 +0100
committerBob Weinand <bobwei9@hotmail.com>2017-03-14 22:15:41 +0100
commit8be63ce0e2046e67e403f5ccd5aa06ecdd94e25c (patch)
treed7ccf8e75d659d6195eee65475134d4de227157a
parentb9d3dbc84e8de18305bb456cff500775f8abf921 (diff)
downloadphp-git-8be63ce0e2046e67e403f5ccd5aa06ecdd94e25c.tar.gz
Fix stream context changes leaking into copies of previous context
-rw-r--r--main/streams/streams.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/main/streams/streams.c b/main/streams/streams.c
index c4cb8d824c..704ab71688 100644
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -2231,6 +2231,7 @@ PHPAPI int php_stream_context_set_option(php_stream_context *context,
zval *wrapperhash;
zval category;
+ SEPARATE_ARRAY(&context->options);
wrapperhash = zend_hash_str_find(Z_ARRVAL(context->options), wrappername, strlen(wrappername));
if (NULL == wrapperhash) {
array_init(&category);
@@ -2241,6 +2242,7 @@ PHPAPI int php_stream_context_set_option(php_stream_context *context,
}
ZVAL_DEREF(optionvalue);
Z_TRY_ADDREF_P(optionvalue);
+ SEPARATE_ARRAY(wrapperhash);
return zend_hash_str_update(Z_ARRVAL_P(wrapperhash), optionname, strlen(optionname), optionvalue) ? SUCCESS : FAILURE;
}
/* }}} */