summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/libarchive/libarchive/bug1066.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/libarchive/libarchive/bug1066.patch')
-rw-r--r--meta/recipes-extended/libarchive/libarchive/bug1066.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/meta/recipes-extended/libarchive/libarchive/bug1066.patch b/meta/recipes-extended/libarchive/libarchive/bug1066.patch
new file mode 100644
index 0000000000..0a662b57b4
--- /dev/null
+++ b/meta/recipes-extended/libarchive/libarchive/bug1066.patch
@@ -0,0 +1,54 @@
1libarchive-3.3.3: Fix bug1066
2
3[No upstream tracking] -- https://github.com/libarchive/libarchive/pull/1066
4
5archive_write_set_format_*.c: fix out of bounds read on empty string () filename
6for guntar, pax and v7tar
7
8There is an out of bounds read flaw in the archive_write_gnutar_header,
9archive_write_pax_header and archive_write_v7tar_header functions which
10could leds to cause a denial of service.
11
12Upstream-Status: Backport [https://github.com/libarchive/libarchive/commit/c246ec5d058a3f70a2d3fb765f92fe9db77b25df]
13Bug: 1066
14Signed-off-by: Andrej Valek <andrej.valek@siemens.com>
15
16diff --git a/libarchive/archive_write_set_format_gnutar.c b/libarchive/archive_write_set_format_gnutar.c
17index 2d858c9..1966c53 100644
18--- a/libarchive/archive_write_set_format_gnutar.c
19+++ b/libarchive/archive_write_set_format_gnutar.c
20@@ -339,7 +339,7 @@ archive_write_gnutar_header(struct archive_write *a,
21 * case getting WCS failed. On POSIX, this is a
22 * normal operation.
23 */
24- if (p != NULL && p[strlen(p) - 1] != '/') {
25+ if (p != NULL && p[0] != '\0' && p[strlen(p) - 1] != '/') {
26 struct archive_string as;
27
28 archive_string_init(&as);
29diff --git a/libarchive/archive_write_set_format_pax.c b/libarchive/archive_write_set_format_pax.c
30index 6a301ac..4cfa8ff 100644
31--- a/libarchive/archive_write_set_format_pax.c
32+++ b/libarchive/archive_write_set_format_pax.c
33@@ -660,7 +660,7 @@ archive_write_pax_header(struct archive_write *a,
34 * case getting WCS failed. On POSIX, this is a
35 * normal operation.
36 */
37- if (p != NULL && p[strlen(p) - 1] != '/') {
38+ if (p != NULL && p[0] != '\0' && p[strlen(p) - 1] != '/') {
39 struct archive_string as;
40
41 archive_string_init(&as);
42diff --git a/libarchive/archive_write_set_format_v7tar.c b/libarchive/archive_write_set_format_v7tar.c
43index 62b1522..53c0db0 100644
44--- a/libarchive/archive_write_set_format_v7tar.c
45+++ b/libarchive/archive_write_set_format_v7tar.c
46@@ -284,7 +284,7 @@ archive_write_v7tar_header(struct archive_write *a, struct archive_entry *entry)
47 * case getting WCS failed. On POSIX, this is a
48 * normal operation.
49 */
50- if (p != NULL && p[strlen(p) - 1] != '/') {
51+ if (p != NULL && p[0] != '\0' && p[strlen(p) - 1] != '/') {
52 struct archive_string as;
53
54 archive_string_init(&as);