From: Mateusz Kocielski Date: Sat, 19 Nov 2011 12:46:43 +0000 (+0000) Subject: - Fixed bug #60337 bcscale related crashed on 64bits platforms X-Git-Tag: php-5.3.9RC2~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17b39638d0a63691dfa5009b9b42342d5ae77f61;p=php - Fixed bug #60337 bcscale related crashed on 64bits platforms --- diff --git a/NEWS b/NEWS index 2c347f3458..40c0661eaf 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,9 @@ PHP NEWS . Enhance error log when the primary script can't be open. FR #60199. (fat) . Added .phar to default authorized extensions. (fat) +- BCmath: + . Fixed bug #60377 (bcscale related crashes on 64bits platforms) (shm) + - EXIF: . Fixed bug #60150 (Integer overflow during the parsing of invalid exif header). (Stas, flolechaud at gmail dot com) diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index f42d3363b3..bd9d6608a3 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -560,7 +560,7 @@ PHP_FUNCTION(bcscale) return; } - BCG(bc_precision) = (new_scale < 0) ? 0 : new_scale; + BCG(bc_precision) = ((int)new_scale < 0) ? 0 : new_scale; RETURN_TRUE; } diff --git a/ext/bcmath/tests/bug60377.phpt b/ext/bcmath/tests/bug60377.phpt new file mode 100644 index 0000000000..7c42002917 --- /dev/null +++ b/ext/bcmath/tests/bug60377.phpt @@ -0,0 +1,13 @@ +--TEST-- +bcscale related problem on 64bits platforms +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +ALIVE