1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 23:18:13 +02:00
Files
archived-php-src/ext/gd/tests/bug77973.phpt
T
Christoph M. Becker a375d54785 Migrate skip checks to --EXTENSIONS-- for ext/gd
Cf. PR #6787.

Closes GH-6994.
2021-05-22 15:38:51 +02:00

26 lines
704 B
PHP

--TEST--
Bug #77973 (Uninitialized read in gdImageCreateFromXbm)
--EXTENSIONS--
gd
--SKIPIF--
<?php
if (!function_exists('imagecreatefromxbm')) die("skip imagecreatefromxbm not available");
?>
--FILE--
<?php
$contents = hex2bin("23646566696e6520776964746820320a23646566696e652068656967687420320a737461746963206368617220626974735b5d203d7b0a7a7a787a7a");
$filepath = __DIR__ . '/bug77973.xbm';
file_put_contents($filepath, $contents);
$im = imagecreatefromxbm($filepath);
var_dump($im);
?>
--EXPECTF--
Warning: imagecreatefromxbm(): Invalid XBM in %s on line %d
Warning: imagecreatefromxbm(): "%s" is not a valid XBM file in %s on line %d
bool(false)
--CLEAN--
<?php
unlink(__DIR__ . '/bug77973.xbm');
?>