]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-compression: ostream-lzma - Compressed output could have been truncated
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 9 Sep 2020 10:00:44 +0000 (13:00 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 10 Sep 2020 13:52:25 +0000 (13:52 +0000)
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

src/lib-compression/ostream-lzma.c

index 55716422583778fb3be78cb8bf61f5aa3237c7f3..fe8bc161ad4fdb62badfce4bd9f38b6ea9be158e 100644 (file)
@@ -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: