From: Ed Catmur Date: Thu, 25 Apr 2019 19:55:40 +0000 (+0200) Subject: Feed at most UINT_MAX data to gzip. X-Git-Tag: v3.4.0~61 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d91ef58185a2f7fa469a0391a6787b60e5b767c9;p=thirdparty%2Flibarchive.git Feed at most UINT_MAX data to gzip. Fixes #1169 --- diff --git a/libarchive/archive_read_support_filter_gzip.c b/libarchive/archive_read_support_filter_gzip.c index cd24d2b12..cbc1039a3 100644 --- a/libarchive/archive_read_support_filter_gzip.c +++ b/libarchive/archive_read_support_filter_gzip.c @@ -37,6 +37,9 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_STRING_H #include #endif +#ifdef HAVE_LIMITS_H +#include +#endif #ifdef HAVE_UNISTD_H #include #endif @@ -440,6 +443,8 @@ gzip_filter_read(struct archive_read_filter *self, const void **p) "truncated gzip input"); return (ARCHIVE_FATAL); } + if (avail_in > UINT_MAX) + avail_in = UINT_MAX; state->stream.avail_in = (uInt)avail_in; /* Decompress and consume some of that data. */