Blame SOURCES/libarchive-3.1.2-CVE-2016-5844.patch

58251f
From 3ad08e01b4d253c66ae56414886089684155af22 Mon Sep 17 00:00:00 2001
58251f
From: Tim Kientzle <kientzle@acm.org>
58251f
Date: Sun, 19 Jun 2016 14:34:37 -0700
58251f
Subject: [PATCH] Issue 717:  Fix integer overflow when computing location of
58251f
 volume descriptor
58251f
58251f
The multiplication here defaulted to 'int' but calculations
58251f
of file positions should always use int64_t.  A simple cast
58251f
suffices to fix this since the base location is always 32 bits
58251f
for ISO, so multiplying by the sector size will never overflow
58251f
a 64-bit integer.
58251f
---
58251f
 libarchive/archive_read_support_format_iso9660.c | 4 ++--
58251f
 1 file changed, 2 insertions(+), 2 deletions(-)
58251f
58251f
diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c
58251f
index 6934cee..f41ba38 100644
58251f
--- a/libarchive/archive_read_support_format_iso9660.c
58251f
+++ b/libarchive/archive_read_support_format_iso9660.c
58251f
@@ -1091,7 +1091,7 @@ choose_volume(struct archive_read *a, struct iso9660 *iso9660)
58251f
 		/* This condition is unlikely; by way of caution. */
58251f
 		vd = &(iso9660->joliet);
58251f
 
58251f
-	skipsize = LOGICAL_BLOCK_SIZE * vd->location;
58251f
+	skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
58251f
 	skipsize = __archive_read_consume(a, skipsize);
58251f
 	if (skipsize < 0)
58251f
 		return ((int)skipsize);
58251f
@@ -1129,7 +1129,7 @@ choose_volume(struct archive_read *a, struct iso9660 *iso9660)
58251f
 	    && iso9660->seenJoliet) {
58251f
 		/* Switch reading data from primary to joliet. */
58251f
 		vd = &(iso9660->joliet);
58251f
-		skipsize = LOGICAL_BLOCK_SIZE * vd->location;
58251f
+		skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
58251f
 		skipsize -= iso9660->current_position;
58251f
 		skipsize = __archive_read_consume(a, skipsize);
58251f
 		if (skipsize < 0)
58251f
-- 
58251f
2.7.4
58251f