1
0
mirror of https://github.com/php/php-src.git synced 2026-04-19 05:51:02 +02:00
Files
archived-php-src/ext/gd/tests/imagebmp_nullbyte_injection.phpt
Máté Kocsis 01b266aac4 Improve error messages of various extensions
Closes GH-5278
2020-03-23 18:59:04 +01:00

19 lines
435 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 ($to) must not contain null bytes