Merge branch 'PHP-8.3' into PHP-8.4

This commit is contained in:
David Carlier 2025-06-29 16:58:05 +01:00
commit ef08bce645
No known key found for this signature in database
GPG key ID: 2FB76A8CE6CD2B41
3 changed files with 17 additions and 1 deletions

2
NEWS
View file

@ -36,6 +36,8 @@ PHP NEWS
- Standard: - Standard:
. Fix misleading errors in printf(). (nielsdos) . Fix misleading errors in printf(). (nielsdos)
. Fix RCN violations in array functions. (nielsdos) . Fix RCN violations in array functions. (nielsdos)
. Fixed GH-18976 pack() overflow with h/H format and INT_MAX repeater value.
(David Carlier)
- Streams: - Streams:
. Fixed GH-13264 (fgets() and stream_get_line() do not return false on filter . Fixed GH-13264 (fgets() and stream_get_line() do not return false on filter

View file

@ -386,7 +386,7 @@ too_few_args:
switch ((int) code) { switch ((int) code) {
case 'h': case 'h':
case 'H': case 'H':
INC_OUTPUTPOS((arg + (arg % 2)) / 2,1) /* 4 bit per arg */ INC_OUTPUTPOS((arg / 2) + (arg % 2),1) /* 4 bit per arg */
break; break;
case 'a': case 'a':

View file

@ -0,0 +1,14 @@
--TEST--
GH-18976 (pack overflow with h/H format)
--INI--
memory_limit=-1
--FILE--
<?php
pack('h2147483647', 1);
pack('H2147483647', 1);
?>
--EXPECTF--
Warning: pack(): Type h: not enough characters in string in %s on line %d
Warning: pack(): Type H: not enough characters in string in %s on line %d