php-8.0.30-src/ext/gd/tests/imagegif_nullbyte_injection...

18 lines
370 B
PHP

--TEST--
Testing null byte injection in imagegif
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
?>
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
try {
imagegif($image, "./foo\0bar");
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
imagegif(): Argument #2 ($file) must not contain null bytes