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:
@@ -183,9 +183,9 @@ PHP_FUNCTION(bindtextdomain)
|
||||
char *retval, dir_name[MAXPATHLEN], *btd_result;
|
||||
|
||||
ZEND_PARSE_PARAMETERS_START(1, 2)
|
||||
Z_PARAM_STR(domain)
|
||||
Z_PARAM_PATH_STR(domain)
|
||||
Z_PARAM_OPTIONAL
|
||||
Z_PARAM_STR_OR_NULL(dir)
|
||||
Z_PARAM_PATH_STR_OR_NULL(dir)
|
||||
ZEND_PARSE_PARAMETERS_END();
|
||||
|
||||
PHP_GETTEXT_DOMAIN_LENGTH_CHECK(1, ZSTR_LEN(domain))
|
||||
|
||||
19
ext/gettext/tests/gh17400.phpt
Normal file
19
ext/gettext/tests/gh17400.phpt
Normal file
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
GH-17400 bindtextdomain segfaults with invalid domain/domain with null bytes.
|
||||
--EXTENSIONS--
|
||||
gettext
|
||||
--CREDITS--
|
||||
YuanchengJiang
|
||||
--FILE--
|
||||
<?php
|
||||
$utf16_first_le = pack("H*", "00d800dc");
|
||||
$utf16le_char_bad = pack("H*", "00dc00dc");
|
||||
|
||||
try {
|
||||
bindtextdomain($utf16le_char_bad,$utf16_first_le);
|
||||
} catch (\ValueError $e) {
|
||||
echo $e->getMessage();
|
||||
}
|
||||
?>
|
||||
--EXPECT--
|
||||
bindtextdomain(): Argument #1 ($domain) must not contain any null bytes
|
||||
Reference in New Issue
Block a user