From 7248341ea6b1209f7aa9b9a978e1b35586ccf523 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 0cbb4bc9c0..b246167ed8 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -4199,7 +4199,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