Mercurial > dovecot > core-2.2
changeset 22881:2027321b23aa
lib-mail: rfc822-parser - Add asserts to make sure parser state is correct
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Fri, 22 Dec 2017 18:31:52 +0200 |
parents | 256a456b2af1 |
children | a04585ef5299 |
files | src/lib-mail/rfc822-parser.c |
diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-mail/rfc822-parser.c Mon Feb 19 14:19:08 2018 +0200 +++ b/src/lib-mail/rfc822-parser.c Fri Dec 22 18:31:52 2017 +0200 @@ -211,6 +211,7 @@ const unsigned char *start; size_t len; + i_assert(ctx->data < ctx->end); i_assert(*ctx->data == '"'); ctx->data++; @@ -313,6 +314,7 @@ %d94-126 ; characters not including "[", ; "]", or "\" */ + i_assert(ctx->data < ctx->end); i_assert(*ctx->data == '['); for (start = ctx->data; ctx->data != ctx->end; ctx->data++) { @@ -338,6 +340,7 @@ domain-literal = [CFWS] "[" *([FWS] dcontent) [FWS] "]" [CFWS] obs-domain = atom *("." atom) */ + i_assert(ctx->data < ctx->end); i_assert(*ctx->data == '@'); ctx->data++;