mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
The provided domain could be a non ascii value even if not supposed to, in the error reported case was of 4 code points long but domain is "empty" leading to a NULL return. It worked up to 8.3 "by accident" before the zend_string conversion and check prior for emptiness. close GH-17402
20 lines
436 B
PHP
20 lines
436 B
PHP
--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
|