]> granicus.if.org Git - php/commitdiff
Fix bug: #17528, do not crash with empty string.
authorfoobar <sniper@php.net>
Fri, 28 Jun 2002 09:23:50 +0000 (09:23 +0000)
committerfoobar <sniper@php.net>
Fri, 28 Jun 2002 09:23:50 +0000 (09:23 +0000)
ext/gd/gd.c

index 4ce04e79aaf6ff8b55219bd4d0bef7fedf95cc2d..67dd792275e65a7d985717b30bc6756f1dc46aa0 100644 (file)
@@ -963,7 +963,7 @@ static int _php_image_type (char data[8])
 #ifdef HAVE_LIBGD15
        /* Based on ext/standard/images.c */
 
-       if (data == NULL)
+       if (data == NULL || strlen(data) <= 0)
                return -1;
 
        if (!memcmp(data, php_sig_gd2, 3))