cvs: gd(GD_2_0) /libgd gd_gif_in.c

[email protected] ("Nuno Lopes")
Newsgroups php.gd.cvs
Message-ID <cvsnlopess1172872742@cvsserver>
nlopess		Fri Mar  2 21:59:02 2007 UTC

  Modified files:              (Branch: GD_2_0)
    /gd/libgd	gd_gif_in.c 
  Log:
  merge with php tree: fix access to unitialized memory (introduced with the strlcpy usage)
  # now gd_strlcpy() becomes useless again :P
  
http://cvs.php.net/viewvc.cgi/gd/libgd/gd_gif_in.c?r1=1.5.2.1&r2=1.5.2.2&diff_format=u
Index: gd/libgd/gd_gif_in.c
diff -u gd/libgd/gd_gif_in.c:1.5.2.1 gd/libgd/gd_gif_in.c:1.5.2.2
--- gd/libgd/gd_gif_in.c:1.5.2.1	Mon Feb 26 23:39:43 2007
+++ gd/libgd/gd_gif_in.c	Fri Mar  2 21:59:02 2007
@@ -115,7 +115,6 @@
        int             bitPixel;
        int	       i;
        /*1.4//int             imageCount = 0; */
-       char            version[4];
        /* 2.0.28: threadsafe storage */
        int ZeroDataBlock = FALSE;
 
@@ -127,8 +126,7 @@
 		return 0;
 	}
 
-				gd_strlcpy(version, (char *)buf + 3, sizeof(version));
-       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)) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.