From: Remi Collet Date: Mon, 22 Apr 2013 15:39:35 +0000 (+0200) Subject: overflow2 is not exported by system libgd X-Git-Tag: php-5.5.0beta4~30 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6889a0d1f5a2eaa8103216d9cb01160e7a637f8d;p=php overflow2 is not exported by system libgd --- diff --git a/ext/gd/libgd/gd_compat.c b/ext/gd/libgd/gd_compat.c index 473ea203e5..b56329029e 100644 --- a/ext/gd/libgd/gd_compat.c +++ b/ext/gd/libgd/gd_compat.c @@ -33,3 +33,14 @@ const char * gdPngGetVersionString() } #endif +int overflow2(int a, int b) +{ + if(a <= 0 || b <= 0) { + return 1; + } + if(a > INT_MAX / b) { + return 1; + } + return 0; +} +