From: Aki Tuomi Date: Thu, 23 Jan 2020 07:54:44 +0000 (+0200) Subject: lib-mail: Add assert to ensure we don't overstep in input_idx_need_encoding X-Git-Tag: 2.3.10~108 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=57792b29d2d562fed3d774abe0b02f1680b41638;p=thirdparty%2Fdovecot%2Fcore.git lib-mail: Add assert to ensure we don't overstep in input_idx_need_encoding Satisfies static analysers. --- diff --git a/src/lib-mail/message-header-encode.c b/src/lib-mail/message-header-encode.c index 38cb86b245..35454aa67b 100644 --- a/src/lib-mail/message-header-encode.c +++ b/src/lib-mail/message-header-encode.c @@ -25,6 +25,7 @@ static bool input_idx_need_encoding(const unsigned char *input, /* trailing LF - we need to drop it */ return TRUE; } + i_assert(i+1 < len); if (input[i+1] != '\t' && input[i+1] != ' ') { /* LF not followed by whitespace - we need to add the whitespace */