]> granicus.if.org Git - php/commitdiff
Fixed a possible crash in parse_context_options()
authorIlia Alshanetsky <iliaa@php.net>
Thu, 19 Jun 2003 16:10:37 +0000 (16:10 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 19 Jun 2003 16:10:37 +0000 (16:10 +0000)
ext/standard/file.c

index 72f3dfd7a44a0ba3f25a917e07e8b3edc66a5ceb..aaf2359f587885682f6fc40fd8faab00eec4de09 100644 (file)
@@ -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);
                                }