Skip to content

Commit 254a7c2

Browse files
committed
Fix # 79171: heap-buffer-overflow in phar_extract_file
We must not access memory outside of the allocated buffer. (cherry picked from commit 7df594b)
1 parent 08b47a3 commit 254a7c2

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ PHP NEWS
3434
- Phar:
3535
. Fixed bug #79082 (Files added to tar with Phar::buildFromIterator have
3636
all-access permissions). (CVE-2020-7063) (stas)
37+
. Fixed bug #79171 (heap-buffer-overflow in phar_extract_file).
38+
(CVE- 2020-7061) (cmb)
3739
. Fixed bug #76584 (PharFileInfo::decompress not working). (cmb)
3840

3941
- Reflection:

ext/phar/phar_object.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4153,7 +4153,7 @@ static int phar_extract_file(zend_bool overwrite, phar_entry_info *entry, char *
41534153
if ('\\' == filename[cnt]) {
41544154
filename[cnt] = '/';
41554155
}
4156-
} while (cnt++ <= filename_len);
4156+
} while (cnt++ < filename_len);
41574157
}
41584158
#endif
41594159

0 commit comments

Comments
 (0)