]> granicus.if.org Git - php/commitdiff
MFB
authorNuno Lopes <nlopess@php.net>
Fri, 2 Mar 2007 18:46:16 +0000 (18:46 +0000)
committerNuno Lopes <nlopess@php.net>
Fri, 2 Mar 2007 18:46:16 +0000 (18:46 +0000)
#Pierre: libgd isn't affected. this problem was caused by the recent conversion to strlcpy()

ext/gd/libgd/gd_gif_in.c

index c25219bb91424a08639ba8687590737e91ce92a6..9ac9e034955342ec2aa2f321c3f21ae2d89e40a9 100644 (file)
@@ -121,7 +121,6 @@ gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) /* {{{ */
        int             bitPixel;
        int            i;
        /*1.4//int             imageCount = 0; */
-       char            version[4];
 
        gdImagePtr im = 0;
        ZeroDataBlock = FALSE;
@@ -133,10 +132,8 @@ gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) /* {{{ */
        if (strncmp((char *)buf,"GIF",3) != 0) {
                return 0;
        }
-       strncpy(version, (char *)buf + 3, 3);
-       version[3] = '\0';
 
-       if ((strcmp(version, "87a") != 0) && (strcmp(version, "89a") != 0)) {
+       if ((strncmp((char *)buf+3, "87a", 3) != 0) && (strncmp((char *)buf+3, "89a", 3) != 0)) {
                return 0;
        }
        if (! ReadOK(fd,buf,7)) {