summaryrefslogtreecommitdiff
path: root/ext/gd/tests/imagexbm_nullbyte_injection.phpt
blob: 8bd90b0d85b2c4c4ff84215ba882080bd164be03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
Testing null byte injection in imagexbm
--SKIPIF--
<?php
if(!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
try {
    imagexbm($image, "./foo\0bar");
} catch (ValueError $e) {
    echo $e->getMessage(), "\n";
}
?>
--EXPECT--
imagexbm(): Argument #2 ($filename) must not contain any null bytes