xref: /PHP-8.0/ext/standard/tests/image/bug79877.phpt (revision 25f1c405)
1--TEST--
2Bug #79877 (getimagesize function silently truncates after a null byte)
3--FILE--
4<?php
5var_dump(getimagesize("/tmp/a.png\0xx"));
6?>
7--EXPECTF--
8Fatal error: Uncaught ValueError: getimagesize(): Argument #1 ($filename) must not contain any null bytes in %s:%d
9Stack trace:
10#0 %s(%d): getimagesize('/tmp/a.png\x00xx')
11#1 {main}
12  thrown in %s on line %d
13