Skip to content

Commit

Permalink
lib-http: Fixed bug in date parser: sometimes read one byte past end …
Browse files Browse the repository at this point in the history
…of input.

This caused spurious parse errors.
  • Loading branch information
stephanbosch committed Jul 27, 2017
1 parent f4b515d commit 76b50cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib-http/http-date.c
Expand Up @@ -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;
Expand Down

0 comments on commit 76b50cc

Please sign in to comment.