]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Fixed potential crash in i_stream_stat() failures.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 13 May 2016 13:23:52 +0000 (09:23 -0400)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 13 May 2016 17:47:10 +0000 (13:47 -0400)
We shouldn't have been copying parent's stream_errno here. Especially
because the parent can be NULL.

src/lib/istream.c

index d525c8b770156323fe05571f962952df35f943b4..c5bf2d6c29e631339d0d221f6668f9707e4544d1 100644 (file)
@@ -808,10 +808,8 @@ static int
 i_stream_default_get_size(struct istream_private *stream,
                          bool exact, uoff_t *size_r)
 {
-       if (stream->stat(stream, exact) < 0) {
-               stream->istream.stream_errno = stream->parent->stream_errno;
+       if (stream->stat(stream, exact) < 0)
                return -1;
-       }
        if (stream->statbuf.st_size == -1)
                return 0;