Skip to content

Commit 4c6fd00

Browse files
committed
ext/mbstring: Check encoding passed to mb_http_output() has no null bytes
1 parent 84f6a7e commit 4c6fd00

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

UPGRADING

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ PHP 8.4 UPGRADE NOTES
2626
Consult sections 2. New Features and 6. New Functions for a list of
2727
newly implemented methods and constants.
2828

29+
- MBString:
30+
. mb_http_output() now checks that the $encoding parameter does not
31+
contain any null bytes. If it does, a ValueError is now thrown.
32+
2933
- PDO_PGSQL:
3034
. The DSN's credentials, when set, are given priority over their PDO
3135
constructor counterparts, being closer to the documentation states.

ext/mbstring/mbstring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1330,7 +1330,7 @@ PHP_FUNCTION(mb_http_output)
13301330

13311331
ZEND_PARSE_PARAMETERS_START(0, 1)
13321332
Z_PARAM_OPTIONAL
1333-
Z_PARAM_STRING_OR_NULL(name, name_len)
1333+
Z_PARAM_PATH_OR_NULL(name, name_len) /* For null byte check */
13341334
ZEND_PARSE_PARAMETERS_END();
13351335

13361336
if (name == NULL) {

0 commit comments

Comments
 (0)