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.3.0.rc1~3768 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6eb0192085073a63ea03443860c412bb5312dd7e;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 e265d1cea8..bcbb027386 100644 --- a/src/lib/istream.c +++ b/src/lib/istream.c @@ -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;