xref: /PHP-8.4/ext/gd/tests/bug73868.phpt (revision 0aaad46c)
1--TEST--
2Bug 73868 (DOS vulnerability in gdImageCreateFromGd2Ctx())
3--EXTENSIONS--
4gd
5--SKIPIF--
6<?php
7    if (!GD_BUNDLED && version_compare(GD_VERSION, '2.3.3', '>=')) {
8        die("skip test requires GD 2.3.2 or older");
9    }
10?>
11--FILE--
12<?php
13var_dump(imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . 'bug73868.gd2'));
14?>
15--EXPECTF--
16Warning: imagecreatefromgd2(): gd2: EOF while reading
17 in %s on line %d
18
19Warning: imagecreatefromgd2(): "%s" is not a valid GD2 file in %s on line %d
20bool(false)
21