]> granicus.if.org Git - php/commitdiff
MFH: fix #38981 (using FTP URLs in get_headers() causes crash)
authorAntony Dovgal <tony2001@php.net>
Thu, 28 Sep 2006 12:55:15 +0000 (12:55 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 28 Sep 2006 12:55:15 +0000 (12:55 +0000)
ext/standard/url.c

index 77e9da11d8d0157cce2ccb8cecea2ab1fbf9a03c..0a4bae9410eeaaa2a5205f85cc54897d27d6ad2e 100644 (file)
@@ -675,6 +675,11 @@ PHP_FUNCTION(get_headers)
                RETURN_FALSE;
        }
 
+       if (!stream->wrapperdata || Z_TYPE_P(stream->wrapperdata) != IS_ARRAY) {
+               php_stream_close(stream);
+               RETURN_FALSE;
+       }
+
        array_init(return_value);
 
        /* check for curl-wrappers that provide headers via a special "headers" element */