Mercurial > dovecot > core-2.2
changeset 5440:d9b7957a7255 HEAD
yet another fix
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 28 Mar 2007 00:56:53 +0300 |
parents | c5401a8f4679 |
children | 9d36800df1ae |
files | src/lib-mail/message-parser.c |
diffstat | 1 files changed, 6 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-mail/message-parser.c Wed Mar 28 00:41:59 2007 +0300 +++ b/src/lib-mail/message-parser.c Wed Mar 28 00:56:53 2007 +0300 @@ -321,12 +321,14 @@ for (i = boundary_start = 0; i < block_r->size; i++) { /* skip to beginning of the next line. the first line was handled already. */ + size_t next_line_idx = block_r->size; + for (; i < block_r->size; i++) { if (data[i] == '\n') { boundary_start = i; if (i > 0 && data[i-1] == '\r') boundary_start--; - i++; + next_line_idx = i + 1; break; } } @@ -336,13 +338,13 @@ full = FALSE; } - ret = boundary_line_find(ctx, block_r->data + i, - block_r->size - i, full, + ret = boundary_line_find(ctx, block_r->data + next_line_idx, + block_r->size - next_line_idx, full, &boundary); if (ret >= 0) { /* found / need more data */ if (ret == 0 && boundary_start == 0) - ctx->want_count += i; + ctx->want_count += next_line_idx; break; } }