]> 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)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Mon, 22 Mar 2021 19:43:01 +0000 (20:43 +0100)
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 1cd21e4562da4ed4b16f250f9cac5c35d526829d..77ddf9bfc89b464f6e28dbb99eb6d7bd4330f0f7 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));
        }
 }