Merge branch 'PHP-8.2' into PHP-8.3

This commit is contained in:
David Carlier 2024-09-11 21:19:58 +01:00
commit eb460229ad
No known key found for this signature in database
GPG key ID: 8486F847B4B94EF1
2 changed files with 12 additions and 3 deletions

9
Zend/tests/gh15712.phpt Normal file
View file

@ -0,0 +1,9 @@
--TEST--
GH-15712: overflow on real number printing
--FILE--
<?php
ini_set('precision', 1100000000);
echo -1 * (2 ** -10);
?>
--EXPECTF--
%s

View file

@ -3613,11 +3613,11 @@ rv_alloc(i) int i;
rv_alloc(int i) rv_alloc(int i)
#endif #endif
{ {
int j, k, *r; int k, *r;
j = sizeof(ULong); size_t j = sizeof(ULong);
for(k = 0; for(k = 0;
sizeof(Bigint) - sizeof(ULong) - sizeof(int) + (size_t)j <= (size_t)i; sizeof(Bigint) - sizeof(ULong) - sizeof(int) + j <= (size_t)i;
j <<= 1) j <<= 1)
k++; k++;
r = (int*)Balloc(k); r = (int*)Balloc(k);