]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: If i_stream_seek() works by reading forward and read() fails, don't override...
authorTimo Sirainen <tss@iki.fi>
Sat, 25 Oct 2014 22:00:36 +0000 (01:00 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 25 Oct 2014 22:00:36 +0000 (01:00 +0300)
src/lib/istream.c

index bcf59a300f44ba809ea3b5e9c1f629d0e33ceb49..ea205b5dd29bcc6d02d14b582bc6398f1d7e924b 100644 (file)
@@ -749,6 +749,10 @@ void i_stream_default_seek_nonseekable(struct istream_private *stream,
 
                available = stream->pos - stream->skip;
                if (available == 0) {
+                       if (stream->istream.stream_errno != 0) {
+                               /* read failed */
+                               return;
+                       }
                        io_stream_set_error(&stream->iostream,
                                "Can't seek to offset %"PRIuUOFF_T
                                ", because we have data only up to offset %"