xref: /PHP-7.2/ext/gd/tests/bug71912.phpt (revision f1d7e3ca)
1--TEST--
2Bug #71912 (libgd: signedness vulnerability)
3--SKIPIF--
4<?php
5        if(!extension_loaded('gd')){ die('skip gd extension not available'); }
6        if (!GD_BUNDLED && version_compare(GD_VERSION, '2.2.0', '<')) {
7            die("skip test requires GD 2.2.0 or higher");
8        }
9        if(!function_exists('imagecreatefromgd2')) die('skip imagecreatefromgd2() not available');
10?>
11--FILE--
12<?php
13imagecreatefromgd2(__DIR__ . DIRECTORY_SEPARATOR . "invalid_neg_size.gd2");
14?>
15OK
16--EXPECTF--
17Warning: imagecreatefromgd2(): '%s%einvalid_neg_size.gd2' is not a valid GD2 file in %s%ebug71912.php on line %d
18OK
19