1
0
mirror of https://github.com/php/php-src.git synced 2026-04-26 01:18:19 +02:00

Bug #71201 round() segfault on 64-bit builds

This commit is contained in:
Anatol Belski
2015-12-23 18:16:52 +01:00
parent dbda61b19b
commit 95454c448b
+9 -1
View File
@@ -390,7 +390,15 @@ PHP_FUNCTION(round)
}
if (ZEND_NUM_ARGS() >= 2) {
places = (int) precision;
#if SIZEOF_LONG > SIZEOF_INT
if (precision >= 0) {
places = precision > INT_MAX ? INT_MAX : (int)precision;
} else {
places = precision <= INT_MIN ? INT_MIN+1 : (int)precision;
}
#else
places = precision;
#endif
}
convert_scalar_to_number_ex(value);