mirror of
https://github.com/php/php-src.git
synced 2026-04-16 20:41:18 +02:00
We must not pretend that there are image data if there are none. Instead we fail reading the image file gracefully. (cherry picked from commit cdb648dc4115ce0722f3cc75e6a65115fc0e56ab)
19 lines
449 B
PHP
19 lines
449 B
PHP
--TEST--
|
|
Bug 73868 (DOS vulnerability in gdImageCreateFromGd2Ctx())
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('gd')) die('skip gd extension not available');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
var_dump(imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . 'bug73868.gd2'));
|
|
?>
|
|
===DONE===
|
|
--EXPECTF--
|
|
Warning: imagecreatefromgd2(): gd2: EOF while reading
|
|
in %s on line %d
|
|
|
|
Warning: imagecreatefromgd2(): '%s' is not a valid GD2 file in %s on line %d
|
|
bool(false)
|
|
===DONE===
|