]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: Fixed bug in date parser: sometimes read one byte past end of input.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 27 Jul 2017 14:30:20 +0000 (16:30 +0200)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 27 Jul 2017 14:47:09 +0000 (16:47 +0200)
This caused spurious parse errors.

src/lib-http/http-date.c

index 6462e376fce6d16fa6238b275a4f6d5d3c113aaf..85102c11424fbd46842230b23b1d7a5ad1be504a 100644 (file)
@@ -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;