From: Timo Sirainen Date: Fri, 13 May 2016 13:23:52 +0000 (-0400) Subject: lib: Fixed potential crash in i_stream_stat() failures. X-Git-Tag: 2.2.25.rc1~300 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6bc001ee9dc03cb3107239861867cd674fd321d7;p=thirdparty%2Fdovecot%2Fcore.git lib: Fixed potential crash in i_stream_stat() failures. We shouldn't have been copying parent's stream_errno here. Especially because the parent can be NULL. --- diff --git a/src/lib/istream.c b/src/lib/istream.c index d525c8b770..c5bf2d6c29 100644 --- a/src/lib/istream.c +++ b/src/lib/istream.c @@ -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;