Skip to content

Commit 5c746c9

Browse files
committed
Fix GH-15712: overflow on float print with precision large value.
When allocating enough room for floats, the allocator used by overflows with large ndigits/EG(precision) value which used an signed integer to double the buffer. Testing with the zend operator directly is enough to trigger the issue rather than higher level math interface.
1 parent 57f9041 commit 5c746c9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Zend/tests/gh15712.phpt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
--TEST--
2+
GH-15712: overflow on real number printing
3+
--FILE--
4+
<?php
5+
ini_set('precision', 1100000000);
6+
echo -1 * (2 ** -10);
7+
?>
8+
--EXPECTF--
9+
%s

0 commit comments

Comments
 (0)