1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.4'

This commit is contained in:
David Carlier
2025-06-29 16:59:04 +01:00
2 changed files with 15 additions and 1 deletions

View File

@@ -366,7 +366,7 @@ too_few_args:
switch (code) {
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;
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