php-src/ext/gd/tests/imagegd_nullbyte_injection.phpt
Nikita Popov 14a26db3e2 Update ext/gd parameter names
Closes GH-6308.
2020-10-09 17:10:11 +02:00

17 lines
380 B
PHP

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