mirror of
https://github.com/php/php-src.git
synced 2025-08-16 22:18:50 +02:00
Fix stream context changes leaking into copies of previous context
This commit is contained in:
parent
b9d3dbc84e
commit
8be63ce0e2
1 changed files with 2 additions and 0 deletions
|
@ -2231,6 +2231,7 @@ PHPAPI int php_stream_context_set_option(php_stream_context *context,
|
||||||
zval *wrapperhash;
|
zval *wrapperhash;
|
||||||
zval category;
|
zval category;
|
||||||
|
|
||||||
|
SEPARATE_ARRAY(&context->options);
|
||||||
wrapperhash = zend_hash_str_find(Z_ARRVAL(context->options), wrappername, strlen(wrappername));
|
wrapperhash = zend_hash_str_find(Z_ARRVAL(context->options), wrappername, strlen(wrappername));
|
||||||
if (NULL == wrapperhash) {
|
if (NULL == wrapperhash) {
|
||||||
array_init(&category);
|
array_init(&category);
|
||||||
|
@ -2241,6 +2242,7 @@ PHPAPI int php_stream_context_set_option(php_stream_context *context,
|
||||||
}
|
}
|
||||||
ZVAL_DEREF(optionvalue);
|
ZVAL_DEREF(optionvalue);
|
||||||
Z_TRY_ADDREF_P(optionvalue);
|
Z_TRY_ADDREF_P(optionvalue);
|
||||||
|
SEPARATE_ARRAY(wrapperhash);
|
||||||
return zend_hash_str_update(Z_ARRVAL_P(wrapperhash), optionname, strlen(optionname), optionvalue) ? SUCCESS : FAILURE;
|
return zend_hash_str_update(Z_ARRVAL_P(wrapperhash), optionname, strlen(optionname), optionvalue) ? SUCCESS : FAILURE;
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue