imagegif_nullbyte_injection.phpt 297 B

123456789101112131415
  1. --TEST--
  2. Testing null byte injection in imagegif
  3. --EXTENSIONS--
  4. gd
  5. --FILE--
  6. <?php
  7. $image = imagecreate(1,1);// 1px image
  8. try {
  9. imagegif($image, "./foo\0bar");
  10. } catch (TypeError $e) {
  11. echo $e->getMessage(), "\n";
  12. }
  13. ?>
  14. --EXPECT--
  15. imagegif(): Argument #2 ($file) must not contain null bytes