~ubuntu-branches/ubuntu/edgy/dovecot/edgy-security

« back to all changes in this revision

Viewing changes to src/lib-storage/index/mbox/istream-raw-mbox.c

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2006-06-30 15:13:37 UTC
  • mfrom: (1.10.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060630151337-l772crcoe5hfd4hw
Tags: 1.0.rc1-1ubuntu1
Merge from debian unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
        if (rstream->hdr_offset + rstream->mail_size < rstream->body_offset) {
108
108
                /* a) Header didn't have ending \n
109
109
                   b) "headers\n\nFrom ..", the second \n belongs to next
110
 
                   message which we didn't know at the time yet. */
 
110
                   message which we didn't know at the time yet.
 
111
 
 
112
                   The +2 check is for CR+LF linefeeds */
 
113
                uoff_t new_body_offset =
 
114
                        rstream->hdr_offset + rstream->mail_size;
111
115
                i_assert(rstream->body_offset == (uoff_t)-1 ||
112
 
                         rstream->body_offset ==
113
 
                         rstream->hdr_offset + rstream->mail_size + 1);
114
 
                rstream->body_offset =
115
 
                        rstream->hdr_offset + rstream->mail_size;
 
116
                         rstream->body_offset == new_body_offset + 1 ||
 
117
                         rstream->body_offset == new_body_offset + 2);
 
118
                rstream->body_offset = new_body_offset;
116
119
        }
117
120
}
118
121
 
190
193
 
191
194
        if (stream->istream.v_offset == rstream->from_offset) {
192
195
                /* beginning of message, we haven't yet read our From-line */
 
196
                if (pos == 2) {
 
197
                        /* we're at the end of file with CR+LF linefeeds?
 
198
                           need more data to verify it. */
 
199
                        rstream->input_peak_offset =
 
200
                                stream->istream.v_offset + pos;
 
201
                        return _read(stream);
 
202
                }
193
203
                if (mbox_read_from_line(rstream) < 0) {
194
204
                        stream->pos = 0;
195
205
                        rstream->eof = TRUE;