diff options
author | Dmitry Stogov <dmitry@zend.com> | 2013-11-29 00:57:49 +0400 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2013-11-29 00:57:49 +0400 |
commit | 6c2a8068207a02b3d7ae7416a9967dad0a81e61f (patch) | |
tree | 3a6671f49b63034cd8c65befe6f8bd6ea84fd89b /ext/soap/php_http.c | |
parent | 5d2576264653c2faaca9cd7d64218d10ab612408 (diff) | |
download | php-git-6c2a8068207a02b3d7ae7416a9967dad0a81e61f.tar.gz |
Avoid interned hash key duplication and hash key length recaclulation
Diffstat (limited to 'ext/soap/php_http.c')
-rw-r--r-- | ext/soap/php_http.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index 86ab03d9c8..14366f12cc 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -807,6 +807,7 @@ try_again: if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_cookies", sizeof("_cookies"), (void **)&cookies) == SUCCESS) { zval **data; char *key; + uint key_len; int i, n; has_cookies = 1; @@ -816,7 +817,7 @@ try_again: smart_str_append_const(&soap_headers, "Cookie: "); for (i = 0; i < n; i++) { zend_hash_get_current_data(Z_ARRVAL_PP(cookies), (void **)&data); - zend_hash_get_current_key(Z_ARRVAL_PP(cookies), &key, NULL, FALSE); + zend_hash_get_current_key_ex(Z_ARRVAL_PP(cookies), &key, &key_len, NULL, 0, NULL); if (Z_TYPE_PP(data) == IS_ARRAY) { zval** value; @@ -829,7 +830,7 @@ try_again: (zend_hash_index_find(Z_ARRVAL_PP(data), 2, (void**)&tmp) == FAILURE || in_domain(phpurl->host,Z_STRVAL_PP(tmp))) && (use_ssl || zend_hash_index_find(Z_ARRVAL_PP(data), 3, (void**)&tmp) == FAILURE)) { - smart_str_appendl(&soap_headers, key, strlen(key)); + smart_str_appendl(&soap_headers, key, key_len); smart_str_appendc(&soap_headers, '='); smart_str_appendl(&soap_headers, Z_STRVAL_PP(value), Z_STRLEN_PP(value)); smart_str_appendc(&soap_headers, ';'); |