diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2016-09-30 20:15:15 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2016-09-30 20:15:15 +0200 |
commit | c60cdac636f3a25f0300538aa3dfb60803e888a1 (patch) | |
tree | e62fadc007109560bbeb3be43a98857665ec1136 | |
parent | e3b889700bcbe419d18e90705dbb3d4582b59a0b (diff) | |
download | php-git-c60cdac636f3a25f0300538aa3dfb60803e888a1.tar.gz |
Fix overflow checks
We check for the proper sizeofs, cf.
<https://github.com/libgd/libgd/commit/c3cf674c>.
-rw-r--r-- | ext/gd/libgd/gd.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 464f8d5b7a..508d66fc74 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -125,12 +125,10 @@ gdImagePtr gdImageCreate (int sx, int sy) if (overflow2(sx, sy)) { return NULL; } - if (overflow2(sizeof(unsigned char *), sy)) { return NULL; } - - if (overflow2(sizeof(unsigned char *), sx)) { + if (overflow2(sizeof(unsigned char), sx)) { return NULL; } @@ -181,12 +179,10 @@ gdImagePtr gdImageCreateTrueColor (int sx, int sy) if (overflow2(sx, sy)) { return NULL; } - - if (overflow2(sizeof(unsigned char *), sy)) { + if (overflow2(sizeof(int *), sy)) { return NULL; } - - if (overflow2(sizeof(int *), sx)) { + if (overflow2(sizeof(int), sx)) { return NULL; } |