File tree 2 files changed +13
-4
lines changed
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ PHP NEWS
28
28
. Fixed bug GH-16508 (Incorrect line number in inheritance errors of delayed
29
29
early bound classes). (ilutov)
30
30
. Fixed bug GH-16648 (Use-after-free during array sorting). (ilutov)
31
+ . Fixed bug GH-15915 (overflow with a high value for precision INI).
32
+ (David Carlier / cmb)
31
33
32
34
- Curl:
33
35
. Fixed bug GH-16302 (CurlMultiHandle holds a reference to CurlHandle if
Original file line number Diff line number Diff line change @@ -3613,13 +3613,20 @@ rv_alloc(i) int i;
3613
3613
rv_alloc (int i )
3614
3614
#endif
3615
3615
{
3616
- int k , * r ;
3617
3616
3618
- size_t j = sizeof (ULong );
3617
+ int j , k , * r ;
3618
+ size_t rem ;
3619
+
3620
+ rem = sizeof (Bigint ) - sizeof (ULong ) - sizeof (int );
3621
+
3622
+
3623
+ j = sizeof (ULong );
3624
+ if (i > ((INT_MAX >> 2 ) + rem ))
3625
+ zend_error_noreturn (E_ERROR , "rv_alloc() allocation overflow %d" , i );
3619
3626
for (k = 0 ;
3620
- sizeof (Bigint ) - sizeof (ULong ) - sizeof (int ) + j <= (size_t )i ;
3621
- j <<= 1 )
3627
+ rem + j <= (size_t )i ; j <<= 1 )
3622
3628
k ++ ;
3629
+
3623
3630
r = (int * )Balloc (k );
3624
3631
* r = k ;
3625
3632
return
You can’t perform that action at this time.
0 commit comments