summaryrefslogtreecommitdiff
path: root/ext/standard/image.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2020-08-02 23:56:37 -0700
committerStanislav Malyshev <stas@php.net>2020-08-02 23:56:37 -0700
commit5b29af5c781980ea48320c612aa38d67bc737e90 (patch)
tree06e52098ac6b794f9a492f75bcd92982d144ad1f /ext/standard/image.c
parent1e0bc6e30f9fb327cd06383c8290a8afab1e484d (diff)
parentff577b04c0d250473a0ef46f8e332960fec3ca2c (diff)
downloadphp-git-5b29af5c781980ea48320c612aa38d67bc737e90.tar.gz
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2: Fix #79877: getimagesize function silently truncates after a null byte Fix #79797: Use of freed hash key in the phar_parse_zipfile function
Diffstat (limited to 'ext/standard/image.c')
-rw-r--r--ext/standard/image.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/standard/image.c b/ext/standard/image.c
index 2aafad9f2a..fc4d6bdc7b 100644
--- a/ext/standard/image.c
+++ b/ext/standard/image.c
@@ -1496,6 +1496,11 @@ static void php_getimagesize_from_any(INTERNAL_FUNCTION_PARAMETERS, int mode) {
Z_PARAM_ZVAL_DEREF(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) {
zval_ptr_dtor(info);
array_init(info);