com php-src: Fix stream context changes leaking into copies of previous context: main/streams/streams.c
| From: | Bob Weinand | Date: | Tue, 14 Mar 2017 21:15:41 +0000 |
| Subject: | com php-src: Fix stream context changes leaking into copies of previous context: main/streams/streams.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-97313@lists.php.net to get a copy of this message | ||
Commit: 8be63ce0e2046e67e403f5ccd5aa06ecdd94e25c
Author: Bob Weinand <bobwei9@hotmail.com> Tue, 14 Mar 2017 22:15:41 +0100
Parents: b9d3dbc84e8de18305bb456cff500775f8abf921
Branches: PHP-7.0
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8be63ce0e2046e67e403f5ccd5aa06ecdd94e25c
Log:
Fix stream context changes leaking into copies of previous context
Changed paths:
M main/streams/streams.c
Diff:
diff --git a/main/streams/streams.c b/main/streams/streams.c
index c4cb8d8..704ab71 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;
}
/* }}} */