1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/ext/standard/tests/network/bug79405.phpt
T
Stanislav Malyshev bf2bb39eac Fix test name
2021-01-04 01:52:59 -08:00

19 lines
467 B
PHP

--TEST--
Bug #79405 - gethostbyname() silently truncates after a null byte
--FILE--
<?php
$host = "localhost\0.example.com";
try {
var_dump(gethostbyname($host));
} catch(Error $e) {
print $e->getMessage()."\n";
}
try {
var_dump(gethostbynamel($host));
} catch(Error $e) {
print $e->getMessage()."\n";
}
?>
--EXPECT--
gethostbyname(): Argument #1 ($hostname) must not contain any null bytes
gethostbynamel(): Argument #1 ($hostname) must not contain any null bytes