From b01b1f65e77325e16f4cca4d0cb1dff48891680c Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 26 Jan 2020 16:03:35 +0100 Subject: [PATCH] Fix # 79171: heap-buffer-overflow in phar_extract_file We must not access memory outside of the allocated buffer. --- ext/phar/phar_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 89b553c2b9..eaa74ece94 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -4184,7 +4184,7 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char * if ('\\' == filename[cnt]) { filename[cnt] = '/'; } - } while (cnt++ <= filename_len); + } while (cnt++ < filename_len); } #endif -- 2.40.0