bug75111.phpt 680 B

123456789101112131415161718192021
  1. --TEST--
  2. Bug #75111 (Memory disclosure or DoS via crafted .bmp image)
  3. --EXTENSIONS--
  4. gd
  5. --FILE--
  6. <?php
  7. // craft BMP image
  8. $str = hex2bin("424D3603000000000000");
  9. $str .= pack("V", -0x120000); // offset of image data
  10. $str .= pack("V", 40); // length of header
  11. $str .= pack("V", 256); // width
  12. $str .= pack("V", 256); // height
  13. $str .= hex2bin("01001800000000000000000000000000000000000000000000000000");
  14. var_dump(imagecreatefromstring($str));
  15. ?>
  16. --EXPECTF--
  17. Warning: imagecreatefromstring(): Passed data is not in "BMP" format in %s on line %d
  18. Warning: imagecreatefromstring(): Couldn't create GD Image Stream out of Data in %s on line %d
  19. bool(false)