From: Tobias Stoeckmann Date: Thu, 9 May 2024 23:49:07 +0000 (+0200) Subject: lzop: Prevent integer overflow (#2174) X-Git-Tag: v3.7.5~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bc1a3e66e3994ef1c70d236d6524c42b46f0f72;p=thirdparty%2Flibarchive.git lzop: Prevent integer overflow (#2174) Cast to int64_t to cover all unsigned 32 bit values without running into issues with C standard. --- diff --git a/libarchive/archive_read_support_filter_lzop.c b/libarchive/archive_read_support_filter_lzop.c index e971063dc..0aa85927b 100644 --- a/libarchive/archive_read_support_filter_lzop.c +++ b/libarchive/archive_read_support_filter_lzop.c @@ -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;