1--TEST-- 2Bug #79405 - gethostbyname() silently truncates after a null byte 3--FILE-- 4<?php 5$host = "localhost\0.example.com"; 6try { 7 var_dump(gethostbyname($host)); 8} catch(Error $e) { 9 print $e->getMessage()."\n"; 10} 11try { 12var_dump(gethostbynamel($host)); 13} catch(Error $e) { 14 print $e->getMessage()."\n"; 15} 16?> 17--EXPECT-- 18gethostbyname(): Argument #1 ($hostname) must not contain any null bytes 19gethostbynamel(): Argument #1 ($hostname) must not contain any null bytes