gnu: Add Combinatorial BLAS.
[jackhill/guix/guix.git] / gnu / packages / patches / libarchive-CVE-2017-14502.patch
CommitLineData
2a0e3d16
LF
1Fix CVE-2017-14502:
2
3https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14502
4https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=573
5
6Patch copied from upstream source repository:
7
8https://github.com/libarchive/libarchive/commit/5562545b5562f6d12a4ef991fae158bf4ccf92b6
9
10From 5562545b5562f6d12a4ef991fae158bf4ccf92b6 Mon Sep 17 00:00:00 2001
11From: Joerg Sonnenberger <joerg@bec.de>
12Date: Sat, 9 Sep 2017 17:47:32 +0200
13Subject: [PATCH] Avoid a read off-by-one error for UTF16 names in RAR
14 archives.
15
16Reported-By: OSS-Fuzz issue 573
17---
18 libarchive/archive_read_support_format_rar.c | 6 +++++-
19 1 file changed, 5 insertions(+), 1 deletion(-)
20
21diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
22index cbb14c32..751de697 100644
23--- a/libarchive/archive_read_support_format_rar.c
24+++ b/libarchive/archive_read_support_format_rar.c
25@@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_entry *entry,
26 return (ARCHIVE_FATAL);
27 }
28 filename[filename_size++] = '\0';
29- filename[filename_size++] = '\0';
30+ /*
31+ * Do not increment filename_size here as the computations below
32+ * add the space for the terminating NUL explicitly.
33+ */
34+ filename[filename_size] = '\0';
35
36 /* Decoded unicode form is UTF-16BE, so we have to update a string
37 * conversion object for it. */
38--
392.15.1
40