lzop: Prevent integer overflow (#2174)

Cast to int64_t to cover all unsigned 32 bit values without running into
issues with C standard.
This commit is contained in:
Tobias Stoeckmann authored and GitHub committed 2024-05-10 01:49:07 +02:00
1 parent dd8f50c317
commit 8bc1a3e66e
1 file changed
+2 -1
@@ -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;