]> granicus.if.org Git - php/commitdiff
Fixed argument numbering
authorDmitry Stogov <dmitry@zend.com>
Tue, 5 Aug 2014 14:17:05 +0000 (18:17 +0400)
committerDmitry Stogov <dmitry@zend.com>
Tue, 5 Aug 2014 14:17:05 +0000 (18:17 +0400)
main/streams/userspace.c

index 12839274c8b34e24c6b80db2bf18183e4741dceb..2bbb1ec277276b3bbacc4f9b3e88942f4487246f 100644 (file)
@@ -370,7 +370,6 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *
        ZVAL_STRING(&args[1], mode);
        ZVAL_LONG(&args[2], options);
        ZVAL_NEW_REF(&args[3], &EG(uninitialized_zval));
-       ZVAL_UNDEF(&args[4]);
 
        ZVAL_STRING(&zfuncname, USERSTREAM_OPEN);
 
@@ -386,8 +385,8 @@ static php_stream *user_wrapper_opener(php_stream_wrapper *wrapper, const char *
                stream = php_stream_alloc_rel(&php_stream_userspace_ops, us, 0, mode);
 
                /* if the opened path is set, copy it out */
-               if (Z_ISREF(args[4]) && Z_TYPE_P(Z_REFVAL(args[4])) == IS_STRING && opened_path) {
-                       *opened_path = estrndup(Z_STRVAL_P(Z_REFVAL(args[4])), Z_STRLEN_P(Z_REFVAL(args[4])));
+               if (Z_ISREF(args[2]) && Z_TYPE_P(Z_REFVAL(args[3])) == IS_STRING && opened_path) {
+                       *opened_path = estrndup(Z_STRVAL_P(Z_REFVAL(args[3])), Z_STRLEN_P(Z_REFVAL(args[3])));
                }
 
                /* set wrapper data to be a reference to our object */