2014-08-25 05:29:05 +08:00
|
|
|
--TEST--
|
|
|
|
Testing null byte injection in imagewebp
|
2021-05-17 04:51:09 +08:00
|
|
|
--EXTENSIONS--
|
|
|
|
gd
|
2014-08-25 05:29:05 +08:00
|
|
|
--SKIPIF--
|
|
|
|
<?php
|
|
|
|
$support = gd_info();
|
2015-07-19 03:33:20 +08:00
|
|
|
if (!isset($support['WebP Support']) || $support['WebP Support'] === false) {
|
2020-09-18 20:28:32 +08:00
|
|
|
print 'skip webp support not available';
|
2014-08-25 05:29:05 +08:00
|
|
|
}
|
|
|
|
?>
|
|
|
|
--FILE--
|
|
|
|
<?php
|
|
|
|
$image = imagecreate(1,1);// 1px image
|
2019-06-13 23:05:47 +08:00
|
|
|
try {
|
|
|
|
imagewebp($image, "./foo\0bar");
|
|
|
|
} catch (TypeError $e) {
|
|
|
|
echo $e->getMessage(), "\n";
|
|
|
|
}
|
2015-07-19 03:33:20 +08:00
|
|
|
?>
|
2019-06-13 23:05:47 +08:00
|
|
|
--EXPECT--
|
2020-10-09 18:28:54 +08:00
|
|
|
imagewebp(): Argument #2 ($file) must not contain null bytes
|