From 30c13ebab36304d99b1fcbb73de205b108509f9c Mon Sep 17 00:00:00 2001 From: Andrew Lukoshko Date: Fri, 15 Nov 2024 13:56:14 +0000 Subject: [PATCH] Update patch --- ...any-selectors-as-the-file-format-allows.patch | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/SOURCES/0001-Accept-as-many-selectors-as-the-file-format-allows.patch b/SOURCES/0001-Accept-as-many-selectors-as-the-file-format-allows.patch index ca4c23b..7645b39 100644 --- a/SOURCES/0001-Accept-as-many-selectors-as-the-file-format-allows.patch +++ b/SOURCES/0001-Accept-as-many-selectors-as-the-file-format-allows.patch @@ -1,7 +1,7 @@ -From b07b105d1b66e32760095e3602261738443b9e13 Mon Sep 17 00:00:00 2001 -From: Mark Wielaard -Date: Wed, 3 Jul 2019 01:28:11 +0200 -Subject: [PATCH] Accept as many selectors as the file format allows. +From 5c93a2ef05285f3e8946aab185c0b44b5abe999f Mon Sep 17 00:00:00 2001 +From: Andrew Lukoshko +Date: Fri, 15 Nov 2024 13:54:11 +0000 +Subject: [PATCH] Accept as many selectors as the file format allows But ignore any larger than the theoretical maximum, BZ_MAX_SELECTORS. @@ -29,13 +29,15 @@ EState struct. But the struct has extra space allocated after the selector arrays of 18060 bytes (which is larger than 14766). All of which will be initialized later (so the overwrite of that space with extra selector values would have been harmless). + +Backport of upstream commit b07b105d1b66e32760095e3602261738443b9e13 --- compress.c | 2 +- decompress.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/compress.c b/compress.c -index 237620d..76adee6 100644 +index caf7696..19b662b 100644 --- a/compress.c +++ b/compress.c @@ -454,7 +454,7 @@ void sendMTFValues ( EState* s ) @@ -48,12 +50,12 @@ index 237620d..76adee6 100644 diff --git a/decompress.c b/decompress.c -index 20ce493..3303499 100644 +index b6e0a29..78060c9 100644 --- a/decompress.c +++ b/decompress.c @@ -287,7 +287,7 @@ Int32 BZ2_decompress ( DState* s ) GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); - if (nGroups < 2 || nGroups > BZ_N_GROUPS) RETURN(BZ_DATA_ERROR); + if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR); GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); - if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR); + if (nSelectors < 1) RETURN(BZ_DATA_ERROR);