1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 06:21:12 +02:00
Files
archived-php-src/ext/gd/tests/imagewebp_nullbyte_injection.phpt
Nikita Popov 14a26db3e2 Update ext/gd parameter names
Closes GH-6308.
2020-10-09 17:10:11 +02:00

22 lines
520 B
PHP

--TEST--
Testing null byte injection in imagewebp
--SKIPIF--
<?php
if(!extension_loaded('gd')){ die('skip gd extension not available'); }
$support = gd_info();
if (!isset($support['WebP Support']) || $support['WebP Support'] === false) {
print 'skip webp support not available';
}
?>
--FILE--
<?php
$image = imagecreate(1,1);// 1px image
try {
imagewebp($image, "./foo\0bar");
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
?>
--EXPECT--
imagewebp(): Argument #2 ($file) must not contain null bytes