From: Bob Weinand Date: Tue, 14 Mar 2017 21:15:41 +0000 (+0100) Subject: Fix stream context changes leaking into copies of previous context X-Git-Tag: php-7.0.18RC1~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8be63ce0e2046e67e403f5ccd5aa06ecdd94e25c;p=php Fix stream context changes leaking into copies of previous context --- 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; } /* }}} */