From 7d43668afe09b1bf5f45870939b24b0bf8fbe9e3 Mon Sep 17 00:00:00 2001 From: Markus Mittendrein Date: Sun, 7 Apr 2019 14:41:03 +0200 Subject: Fix wrong reporting of garbage data at the end of the group --- src/cc4group.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/cc4group.c b/src/cc4group.c index a664fe3..d376873 100644 --- a/src/cc4group.c +++ b/src/cc4group.c @@ -721,8 +721,9 @@ static bool cc4group_uncompressGroup(CC4Group* const this, CC4Group_ReadCallback goto ret; } - if(strm.avail_in > 0 || ret != Z_STREAM_END) + if(strm.avail_in > 0) { + // NOTE: This may miss additional garbage data at the end if the read callback happens to read exactly the right amount of data SET_MALFORMED_MESSAGE_ERROR("The group contents are read completely but more data is left to read"); goto ret; } -- cgit v1.2.3-54-g00ecf