Skip to content

Commit eb46022

Browse files
committed
Merge branch 'PHP-8.2' into PHP-8.3
2 parents b975b6c + 503d914 commit eb46022

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

Zend/tests/gh15712.phpt

+9
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

Zend/zend_strtod.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -3613,11 +3613,11 @@ rv_alloc(i) int i;
36133613
rv_alloc(int i)
36143614
#endif
36153615
{
3616-
int j, k, *r;
3616+
int k, *r;
36173617

3618-
j = sizeof(ULong);
3618+
size_t j = sizeof(ULong);
36193619
for(k = 0;
3620-
sizeof(Bigint) - sizeof(ULong) - sizeof(int) + (size_t)j <= (size_t)i;
3620+
sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= (size_t)i;
36213621
j <<= 1)
36223622
k++;
36233623
r = (int*)Balloc(k);

0 commit comments

Comments
 (0)