]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
lzop: Prevent integer overflow (#2174)
authorTobias Stoeckmann <stoeckmann@users.noreply.github.com>
Thu, 9 May 2024 23:49:07 +0000 (01:49 +0200)
committerGitHub <noreply@github.com>
Thu, 9 May 2024 23:49:07 +0000 (01:49 +0200)
Cast to int64_t to cover all unsigned 32 bit values without running into
issues with C standard.

libarchive/archive_read_support_filter_lzop.c

index e971063dc68fbc0712df3d69e23fd3c2e9df8fbc..0aa85927b4a00043961840257e8ffb5c9575ac16 100644 (file)
@@ -291,7 +291,8 @@ consume_header(struct archive_read_filter *self)
                if (p == NULL)
                        goto truncated;
                len = archive_be32dec(p);
-               __archive_read_filter_consume(self->upstream, len + 4 + 4);
+               __archive_read_filter_consume(self->upstream,
+                   (int64_t)len + 4 + 4);
        }
        state->flags = flags;
        state->in_stream = 1;