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

index 6888ec26741b2a59fc8b91c44bc1beb090c1358a..41e03d5a34e265026ab6e305409c4ed09b55e8e8 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 */