We have to check for NUL bytes if `getimagesize()` has been called.
Z_PARAM_ZVAL(info)
ZEND_PARSE_PARAMETERS_END();
+ if (mode == FROM_PATH && CHECK_NULL_PATH(input, input_len)) {
+ php_error_docref(NULL, E_WARNING, "Invalid path");
+ return;
+ }
+
if (argc == 2) {
info = zend_try_array_init(info);
if (!info) {
--- /dev/null
+--TEST--
+Bug #79877 (getimagesize function silently truncates after a null byte)
+--FILE--
+<?php
+var_dump(getimagesize("/tmp/a.png\0xx"));
+?>
+--EXPECTF--
+Warning: getimagesize(): Invalid path in %s on line %d
+NULL