]> 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 13:23:52 +0000 (09:23 -0400)
We shouldn't have been copying parent's stream_errno here. Especially
because the parent can be NULL.

src/lib/istream.c

index e265d1cea817e5ed4dba3406d1d713cd8d420f0b..bcbb027386408f8396638b8a4445de5b5beba724 100644 (file)
@@ -811,10 +811,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;