[git commit] bunzip2: the correct condition is "n < groupCount", not "n <= groupCount". Closes 11896

Denys Vlasenko vda.linux at googlemail.com
Thu May 23 12:54:13 UTC 2019


commit: https://git.busybox.net/busybox/commit/?id=58d998d2f927c20f2ba728611df587ac8ec8bda9
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
get_next_block                                      1677    1681      +4

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 archival/libarchive/decompress_bunzip2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/archival/libarchive/decompress_bunzip2.c b/archival/libarchive/decompress_bunzip2.c
index 78366f26a..1f535b32a 100644
--- a/archival/libarchive/decompress_bunzip2.c
+++ b/archival/libarchive/decompress_bunzip2.c
@@ -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];


More information about the busybox-cvs mailing list