diff options
| author | Mateusz Kocielski <shm@php.net> | 2011-11-19 12:46:43 +0000 |
|---|---|---|
| committer | Mateusz Kocielski <shm@php.net> | 2011-11-19 12:46:43 +0000 |
| commit | 17b39638d0a63691dfa5009b9b42342d5ae77f61 (patch) | |
| tree | 9ae72aa070209e7575af816569e65a317cc177ac | |
| parent | b7e84d6b833b3ac897f30657924edddc5df82a6a (diff) | |
| download | php-git-17b39638d0a63691dfa5009b9b42342d5ae77f61.tar.gz | |
- Fixed bug #60337 bcscale related crashed on 64bits platforms
| -rw-r--r-- | NEWS | 3 | ||||
| -rw-r--r-- | ext/bcmath/bcmath.c | 2 | ||||
| -rw-r--r-- | ext/bcmath/tests/bug60377.phpt | 13 |
3 files changed, 17 insertions, 1 deletions
@@ -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-- +<?php if(!extension_loaded("bcmath")) print "skip"; ?> +--FILE-- +<?php +$var48 = bcscale(634314234334311); +$var67 = bcsqrt(false); +$var414 = bcadd(false,null,10); +die('ALIVE'); +?> +--EXPECTF-- +ALIVE |
