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