php-src/ext/gd/tests/bug75571.phpt
Christoph M. Becker 8d6e958867 Fixed bug #75571: Potential infinite loop in gdImageCreateFromGifCtx
Due to a signedness confusion in `GetCode_` a corrupt GIF file can
trigger an infinite loop.  Furthermore we make sure that a GIF without
any palette entries is treated as invalid *after* open palette entries
have been removed.
2018-01-01 19:51:26 -08:00

16 lines
350 B
PHP

--TEST--
Bug #75571 (Infinite loop in GIF reading causing DoS)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
var_dump(imagecreatefromgif(__DIR__ . '/bug75571.gif'));
?>
===DONE===
--EXPECTF--
Warning: imagecreatefromgif(): '%s' is not a valid GIF file in %s on line %d
bool(false)
===DONE===