bunzip2: the correct condition is "n < groupCount", not "n <= groupCount". Closes...
authorDenys Vlasenko <vda.linux@googlemail.com>
Thu, 23 May 2019 12:54:13 +0000 (14:54 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 23 May 2019 12:54:13 +0000 (14:54 +0200)
function                                             old     new   delta
get_next_block                                      1677    1681      +4

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
archival/libarchive/decompress_bunzip2.c

index 78366f26a00a4364be24ebb54795670dc7e9551c..1f535b32a033926e089c2c9348652c15228fc8f1 100644 (file)
@@ -235,9 +235,9 @@ static int get_next_block(bunzip_data *bd)
                /* Get next value */
                int n = 0;
                while (get_bits(bd, 1)) {
+                       n++;
                        if (n >= groupCount)
                                return RETVAL_DATA_ERROR;
-                       n++;
                }
                /* Decode MTF to get the next selector */
                tmp_byte = mtfSymbol[n];