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/gd/tests/imagebmp_nullbyte_injection.phpt
T
Nikita Popov 14a26db3e2 Update ext/gd parameter names
Closes GH-6308.
2020-10-09 17:10:11 +02:00

19 lines
437 B
PHP

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