]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
compress: Remove harmful "dead" code 3051/head
authorTobias Stoeckmann <tobias@stoeckmann.org>
Tue, 19 May 2026 15:32:26 +0000 (17:32 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Tue, 19 May 2026 15:32:26 +0000 (17:32 +0200)
The debug_buff array is populated but never read. If multiple threads
process compress streams, they access the same index variable, which
could lead to out of boundary writes.

Delete the debug code to fix this issue.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
libarchive/archive_read_support_filter_compress.c

index 57f320e83d60cf98f3383e6067738ec3d6d4ad46..64f5201efbf9911f37ee4b610cbf8ea90f625936 100644 (file)
@@ -339,18 +339,11 @@ next_code(struct archive_read_filter *self)
        struct private_data *state = (struct private_data *)self->data;
        int code, newcode;
 
-       static int debug_buff[1024];
-       static unsigned debug_index;
-
 again:
        code = newcode = getbits(self, state->bits);
        if (code < 0)
                return (code);
 
-       debug_buff[debug_index++] = code;
-       if (debug_index >= sizeof(debug_buff)/sizeof(debug_buff[0]))
-               debug_index = 0;
-
        /* If it's a reset code, reset the dictionary. */
        if ((code == 256) && state->use_reset_code) {
                /*