diff options
author | Federico Mena Quintero <federico@gnome.org> | 2019-05-29 17:14:27 -0500 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2019-06-24 15:41:58 +0200 |
commit | ff986850159a1ea0c75617ffa792d1bb2069856e (patch) | |
tree | e4d1b7ae239c0dbf1576a4d927c42ef5c50b0988 | |
parent | 7ed62bfb46e87a9e878712603469440e6882b184 (diff) | |
download | bzip2-ff986850159a1ea0c75617ffa792d1bb2069856e.tar.gz bzip2-ff986850159a1ea0c75617ffa792d1bb2069856e.tar.bz2 bzip2-ff986850159a1ea0c75617ffa792d1bb2069856e.zip |
Change a magic number (6) for a constant (BZ_N_GROUPS).
decompress.c (BZ2_decompress): Check nGroups against BZ_N_GROUPS.
-rw-r--r-- | decompress.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/decompress.c b/decompress.c index f3db91d..7351134 100644 --- a/decompress.c +++ b/decompress.c | |||
@@ -285,7 +285,7 @@ Int32 BZ2_decompress ( DState* s ) | |||
285 | 285 | ||
286 | /*--- Now the selectors ---*/ | 286 | /*--- Now the selectors ---*/ |
287 | GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); | 287 | GET_BITS(BZ_X_SELECTOR_1, nGroups, 3); |
288 | if (nGroups < 2 || nGroups > 6) RETURN(BZ_DATA_ERROR); | 288 | if (nGroups < 2 || nGroups > BZ_N_GROUPS) RETURN(BZ_DATA_ERROR); |
289 | GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); | 289 | GET_BITS(BZ_X_SELECTOR_2, nSelectors, 15); |
290 | if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR); | 290 | if (nSelectors < 1 || nSelectors > BZ_MAX_SELECTORS) RETURN(BZ_DATA_ERROR); |
291 | for (i = 0; i < nSelectors; i++) { | 291 | for (i = 0; i < nSelectors; i++) { |