From c60cdac636f3a25f0300538aa3dfb60803e888a1 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Fri, 30 Sep 2016 20:15:15 +0200 Subject: [PATCH] Fix overflow checks We check for the proper sizeofs, cf. . --- ext/gd/libgd/gd.c | 10 +++------- 1 file 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; } -- 2.50.1