From: Timo Sirainen Date: Wed, 9 Sep 2020 10:00:44 +0000 (+0300) Subject: lib-compression: ostream-lzma - Compressed output could have been truncated X-Git-Tag: 2.3.13~229 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d0f6cf3e04da0d85bbb853fbf4c6dff1d08af50;p=thirdparty%2Fdovecot%2Fcore.git lib-compression: ostream-lzma - Compressed output could have been truncated The compression wasn't fully finished, resulting in truncated compressed output that couldn't be fully read back. Reading would result in "Broken pipe" errors. Broken by 6080aa16e1bd50cd661acc31203d9f4986a9450a --- diff --git a/src/lib-compression/ostream-lzma.c b/src/lib-compression/ostream-lzma.c index 5571642258..fe8bc161ad 100644 --- a/src/lib-compression/ostream-lzma.c +++ b/src/lib-compression/ostream-lzma.c @@ -140,7 +140,10 @@ static int o_stream_lzma_send_flush(struct lzma_ostream *zstream, bool final) ret = lzma_code(zs, LZMA_FINISH); switch (ret) { case LZMA_OK: + /* still unfinished - need to call lzma_code() again */ + break; case LZMA_STREAM_END: + /* output is fully finished */ done = TRUE; break; case LZMA_MEM_ERROR: