imagebmp_nullbyte_injection.phpt 387 B

12345678910111213141516171819
  1. --TEST--
  2. Testing null byte injection in imagebmp
  3. --EXTENSIONS--
  4. gd
  5. --SKIPIF--
  6. <?php
  7. if (!gd_info()['BMP Support']) die('skip BMP support not available');
  8. ?>
  9. --FILE--
  10. <?php
  11. $image = imagecreate(1,1);// 1px image
  12. try {
  13. imagebmp($image, "./foo\0bar");
  14. } catch (TypeError $e) {
  15. echo $e->getMessage(), "\n";
  16. }
  17. ?>
  18. --EXPECT--
  19. imagebmp(): Argument #2 ($file) must not contain null bytes