Blame SOURCES/libarchive-3.1.2-CVE-2017-14503.patch

58251f
From 2c8c83b9731ff822fad6cc8c670ea5519c366a14 Mon Sep 17 00:00:00 2001
58251f
From: Joerg Sonnenberger <joerg@bec.de>
58251f
Date: Thu, 19 Jul 2018 21:14:53 +0200
58251f
Subject: [PATCH] Reject LHA archive entries with negative size.
58251f
58251f
---
58251f
 libarchive/archive_read_support_format_lha.c | 6 ++++++
58251f
 1 file changed, 6 insertions(+)
58251f
58251f
diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c
58251f
index b8ef4ae1..95c99bb1 100644
58251f
--- a/libarchive/archive_read_support_format_lha.c
58251f
+++ b/libarchive/archive_read_support_format_lha.c
58251f
@@ -701,6 +701,12 @@ archive_read_format_lha_read_header(struct archive_read *a,
58251f
 	 * Prepare variables used to read a file content.
58251f
 	 */
58251f
 	lha->entry_bytes_remaining = lha->compsize;
58251f
+	if (lha->entry_bytes_remaining < 0) {
58251f
+		archive_set_error(&a->archive,
58251f
+		    ARCHIVE_ERRNO_FILE_FORMAT,
58251f
+		    "Invalid LHa entry size");
58251f
+		return (ARCHIVE_FATAL);
58251f
+	}
58251f
 	lha->entry_offset = 0;
58251f
 	lha->entry_crc_calculated = 0;
58251f
 
58251f
-- 
58251f
2.20.1
58251f