From 254a7c245773d0dd16ead79a598f415dd0d6ee92 Mon Sep 17 00:00:00 2001 From: "Christoph M. Becker" Date: Sun, 26 Jan 2020 16:03:35 +0100 Subject: Fix # 79171: heap-buffer-overflow in phar_extract_file We must not access memory outside of the allocated buffer. (cherry picked from commit 7df594b9437aa4f127581e4c88da99e7c41a9b14) --- ext/phar/phar_object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/phar/phar_object.c') diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 14b4a795d0..82c7c376ed 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -4153,7 +4153,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 -- cgit v1.2.1