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