summaryrefslogtreecommitdiff
path: root/ext/gd/tests/imagebmp_nullbyte_injection.phpt
blob: 00d0a7168c7f0f4b599b35fa4a6914d222fa99ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--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--
Invalid 2nd parameter, filename must not contain null bytes