summaryrefslogtreecommitdiff
path: root/app-arch/bzip2/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-04-28 09:54:45 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-04-28 09:54:45 +0100
commitb7ebc951da8800f711142f69d9d958bde67a112d (patch)
treee318514216845acb8f2e49fff7a5cba4027e9d91 /app-arch/bzip2/files
parentdc7cbdfa65fd814b3b9aa3c56257da201109e807 (diff)
gentoo resync : 28.04.2019
Diffstat (limited to 'app-arch/bzip2/files')
-rw-r--r--app-arch/bzip2/files/bzip2-1.0.6-nselectors-upper-bound-check.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/app-arch/bzip2/files/bzip2-1.0.6-nselectors-upper-bound-check.patch b/app-arch/bzip2/files/bzip2-1.0.6-nselectors-upper-bound-check.patch
new file mode 100644
index 000000000000..a7731f7de8f7
--- /dev/null
+++ b/app-arch/bzip2/files/bzip2-1.0.6-nselectors-upper-bound-check.patch
@@ -0,0 +1,30 @@
+From 13ca8fee0c897121ae79ae644a212418398dfea7 Mon Sep 17 00:00:00 2001
+From: Amin Hassani <ahassani@chromium.org>
+Date: Fri, 8 Mar 2019 09:58:20 -0800
+Subject: [PATCH] Check for upper bounds of nselectors.
+
+Currently there is no check for the upper bounds of the
+nselectors. Hence, a corrupt input can cause a segfault.
+
+This issue was discovered by one of our fuzzers. The actual error was:
+
+../bzip2-1.0.6/decompress.c:299:10: runtime error: index 18002 out of bounds for type 'UChar [18002]'
+---
+ decompress.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/decompress.c b/decompress.c
+index 311f566..391552d 100644
+--- a/decompress.c
++++ b/decompress.c
+@@ -288,6 +288,7 @@ Int32 BZ2_decompress ( DState* s )
+ if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR);
+ GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15);
+ if (nSelectors < 1) RETURN(BZ_DATA_ERROR);
++ if (nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR);
+ for (i = 0; i < nSelectors; i++) {
+ j = 0;
+ while (True) {
+--
+2.21.0.360.g471c308f928-goog
+