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