From: Stephan Bosch Date: Thu, 27 Jul 2017 14:30:20 +0000 (+0200) Subject: lib-http: Fixed bug in date parser: sometimes read one byte past end of input. X-Git-Tag: 2.3.0.rc1~1205 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=76b50cc56df43d114f2363ec3066cf4a807eca49;p=thirdparty%2Fdovecot%2Fcore.git lib-http: Fixed bug in date parser: sometimes read one byte past end of input. This caused spurious parse errors. --- diff --git a/src/lib-http/http-date.c b/src/lib-http/http-date.c index 6462e376fc..85102c1142 100644 --- a/src/lib-http/http-date.c +++ b/src/lib-http/http-date.c @@ -140,8 +140,8 @@ http_date_parse_word(struct http_date_parser *parser, str_append_c(word, parser->cur[0]); parser->cur++; } - - if (i_isalpha(parser->cur[0])) + + if (parser->cur < parser->end && i_isalpha(parser->cur[0])) return -1; *word_r = word; return 1;