From 6889a0d1f5a2eaa8103216d9cb01160e7a637f8d Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 22 Apr 2013 17:39:35 +0200 Subject: [PATCH] overflow2 is not exported by system libgd --- ext/gd/libgd/gd_compat.c | 11 +++++++++++ 1 file changed, 11 insertions(+) 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; +} + -- 2.50.1