diff options
author | Nuno Lopes <nlopess@php.net> | 2007-03-02 18:41:25 +0000 |
---|---|---|
committer | Nuno Lopes <nlopess@php.net> | 2007-03-02 18:41:25 +0000 |
commit | 7b37c413849a176b198d4b35e26e93fbe1dc472e (patch) | |
tree | 98f266baeffc969b1fb319449d58b95607ab0a45 | |
parent | f87f4a1468ff47cfae80311677f664dd05b507f1 (diff) | |
download | php-git-7b37c413849a176b198d4b35e26e93fbe1dc472e.tar.gz |
fix access to non initialized memory (check valgrind reports on http://gcov.php.net)
-rw-r--r-- | ext/gd/libgd/gd_gif_in.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ext/gd/libgd/gd_gif_in.c b/ext/gd/libgd/gd_gif_in.c index a770e16893..a5725e1115 100644 --- a/ext/gd/libgd/gd_gif_in.c +++ b/ext/gd/libgd/gd_gif_in.c @@ -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,9 +132,8 @@ gdImagePtr gdImageCreateFromGifCtx(gdIOCtxPtr fd) /* {{{ */ if (strncmp((char *)buf,"GIF",3) != 0) { return 0; } - 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)) { |