]> granicus.if.org Git - php/commitdiff
fix for crashbug with user level wrapper implementations of stream_stat
authorHartmut Holzgraefe <hholzgra@php.net>
Thu, 29 May 2003 20:19:03 +0000 (20:19 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Thu, 29 May 2003 20:19:03 +0000 (20:19 +0000)
main/streams/userspace.c

index 6645704ff3018a8c34056f6232584a56117af15e..f17f6a278ed0cd31830f1c50454d8b826166bbaf 100644 (file)
@@ -630,17 +630,16 @@ static int php_userstreamop_seek(php_stream *stream, off_t offset, int whence, o
        return 0;
 }
 
-
 /* parse the return value from one of the stat functions and store the
  * relevant fields into the statbuf provided */
 static int statbuf_from_array(zval *array, php_stream_statbuf *ssb TSRMLS_DC)
 {
-       zval *elem;
+       zval **elem;
 
 #define STAT_PROP_ENTRY_EX(name, name2)                        \
        if (SUCCESS == zend_hash_find(Z_ARRVAL_P(array), #name, sizeof(#name), (void**)&elem)) {     \
-               convert_to_long(elem);                                                                   \
-               ssb->sb.st_##name2 = Z_LVAL_P(elem);                                                      \
+               convert_to_long(*elem);                                                                   \
+               ssb->sb.st_##name2 = Z_LVAL_PP(elem);                                                      \
        }
 
 #define STAT_PROP_ENTRY(name) STAT_PROP_ENTRY_EX(name,name)
@@ -701,7 +700,7 @@ static int php_userstreamop_stat(php_stream *stream, php_stream_statbuf *ssb TSR
                                        us->wrapper->classname);
                }
        }
-       
+
        if (retval) 
                zval_ptr_dtor(&retval);