Fix stream context changes leaking into copies of previous context

This commit is contained in:
Bob Weinand 2017-03-14 22:15:41 +01:00
parent b9d3dbc84e
commit 8be63ce0e2

View file

@ -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;
}
/* }}} */