]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-compression: Get error with i_stream_get_error() so it's recursive
authorMarkus Valentin <markus.valentin@open-xchange.com>
Mon, 22 Mar 2021 12:04:15 +0000 (13:04 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Tue, 23 Mar 2021 12:26:10 +0000 (12:26 +0000)
In some cases the iostream.error was NULL so the errno default message
was used. This fixes an regression introduced by 8b6142f9ba9.

src/lib-compression/istream-decompress.c

index bec7b46e53688f2fa8694e0e7f5135ab4ab1e82b..27a7f18b6ab6cd9e03c5c3c66418a49422925461 100644 (file)
@@ -17,9 +17,9 @@ static void copy_compressed_input_error(struct decompress_istream *zstream)
 
        stream->istream.stream_errno = zstream->compressed_input->stream_errno;
        stream->istream.eof = zstream->compressed_input->eof;
-       if (zstream->compressed_input->real_stream->iostream.error != NULL) {
+       if (zstream->compressed_input->stream_errno != 0) {
                io_stream_set_error(&stream->iostream, "%s",
-                       zstream->compressed_input->real_stream->iostream.error);
+                       i_stream_get_error(&zstream->compressed_input->real_stream->istream));
        }
 }
 
@@ -29,9 +29,9 @@ static void copy_decompressed_input_error(struct decompress_istream *zstream)
 
        stream->istream.stream_errno = zstream->decompressed_input->stream_errno;
        stream->istream.eof = zstream->decompressed_input->eof;
-       if (zstream->decompressed_input->real_stream->iostream.error != NULL) {
+       if (zstream->decompressed_input->stream_errno != 0) {
                io_stream_set_error(&stream->iostream, "%s",
-                       zstream->decompressed_input->real_stream->iostream.error);
+                       i_stream_get_error(&zstream->decompressed_input->real_stream->istream));
        }
 }