bug77973.phpt 704 B

12345678910111213141516171819202122232425
  1. --TEST--
  2. Bug #77973 (Uninitialized read in gdImageCreateFromXbm)
  3. --EXTENSIONS--
  4. gd
  5. --SKIPIF--
  6. <?php
  7. if (!function_exists('imagecreatefromxbm')) die("skip imagecreatefromxbm not available");
  8. ?>
  9. --FILE--
  10. <?php
  11. $contents = hex2bin("23646566696e6520776964746820320a23646566696e652068656967687420320a737461746963206368617220626974735b5d203d7b0a7a7a787a7a");
  12. $filepath = __DIR__ . '/bug77973.xbm';
  13. file_put_contents($filepath, $contents);
  14. $im = imagecreatefromxbm($filepath);
  15. var_dump($im);
  16. ?>
  17. --EXPECTF--
  18. Warning: imagecreatefromxbm(): Invalid XBM in %s on line %d
  19. Warning: imagecreatefromxbm(): "%s" is not a valid XBM file in %s on line %d
  20. bool(false)
  21. --CLEAN--
  22. <?php
  23. unlink(__DIR__ . '/bug77973.xbm');
  24. ?>