]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mbox: Don't crash with invalid From_-lines.
authorTimo Sirainen <tss@iki.fi>
Thu, 11 Jun 2009 18:53:31 +0000 (14:53 -0400)
committerTimo Sirainen <tss@iki.fi>
Thu, 11 Jun 2009 18:53:31 +0000 (14:53 -0400)
--HG--
branch : HEAD

src/lib-storage/index/mbox/istream-raw-mbox.c

index 7e934d84adfaf86b3ce99d5b231afc763267ab23..52416c403509dcc12e568c1ef27d4af2d727036d 100644 (file)
@@ -336,7 +336,7 @@ static ssize_t i_stream_raw_mbox_read(struct istream_private *stream)
                                                           from_start_pos);
                                        break;
                                }
-                               from_start_pos = (size_t)-1;
+                               from_after_pos = (size_t)-1;
                        }
                } else {
                        fromp = mbox_from;
@@ -348,7 +348,7 @@ static ssize_t i_stream_raw_mbox_read(struct istream_private *stream)
        /* we want to go at least one byte further next time */
        rstream->input_peak_offset = stream->istream.v_offset + i;
 
-       if (from_start_pos != (size_t)-1) {
+       if (from_after_pos != (size_t)-1) {
                /* we're waiting for the \n at the end of From-line */
                new_pos = from_start_pos;
        } else {