Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ PHP NEWS
. Fixed bug GH-23758 (PDO_Firebird returns null for non-null empty BLOBs).
(Lazizbek Ergashev)

- Phar:
. Fixed bug GH-22556 (OOM DoS via oversized ././@LongLink entry in TAR phar).
(crystarm)

- Readline:
. Fixed a heap over-read in the interactive shell prompt when cli.prompt is
set to an empty string. (Ilia Alshanetsky)
Expand Down
6 changes: 4 additions & 2 deletions ext/phar/tar.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,10 @@ zend_result phar_parse_tarfile(php_stream* fp, char *fname, size_t fname_len, ch
/* support the ././@LongLink system for storing long filenames */
entry.filename_len = entry.uncompressed_filesize;

/* Check for overflow - bug 61065 */
if (entry.filename_len == 0 || entry.filename_len > totalsize) {
/* Check for empty, truncated, or excessively large ././@LongLink filename entries - bug 61065 */
if (entry.filename_len == 0
|| entry.filename_len > totalsize
|| entry.filename_len > UINT16_MAX) {
if (error) {
spprintf(error, 4096, "phar error: \"%s\" is a corrupted tar file (invalid entry size)", fname);
}
Expand Down
Loading