summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-06-19 16:10:37 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-06-19 16:10:37 +0000
commit3924c1eabfa18d7b22d5917c8d6c44c8116606ba (patch)
tree8ffdbf134f13c80a4103404f1d27e72e03ed09d6
parent929ab8b529efcf9307ac97ae7958f22f1c487ef8 (diff)
downloadphp-git-3924c1eabfa18d7b22d5917c8d6c44c8116606ba.tar.gz
Fixed a possible crash in parse_context_options()
-rw-r--r--ext/standard/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 72f3dfd7a4..aaf2359f58 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -877,16 +877,17 @@ static int parse_context_options(php_stream_context *context, zval *options)
char *wkey, *okey;
int wkey_len, okey_len;
int ret = SUCCESS;
+ ulong num_key;
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(options), &pos);
while (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(options), (void**)&wval, &pos)) {
- if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_P(options), &wkey, &wkey_len, NULL, 0, &pos)
+ if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_P(options), &wkey, &wkey_len, &num_key, 0, &pos)
&& Z_TYPE_PP(wval) == IS_ARRAY) {
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(wval), &opos);
while (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(wval), (void**)&oval, &opos)) {
- if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_PP(wval), &okey, &okey_len, NULL, 0, &opos)) {
+ if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_PP(wval), &okey, &okey_len, &num_key, 0, &opos)) {
ZVAL_ADDREF(*oval);
php_stream_context_set_option(context, wkey, okey, *oval);
}