]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: request parser: Made sure that partially parsed requests never have stale...
authorStephan Bosch <stephan@rename-it.nl>
Mon, 8 Feb 2016 21:49:28 +0000 (22:49 +0100)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 10 Feb 2016 11:55:26 +0000 (13:55 +0200)
Due to the fact that we assign method and target fields early for proper
error messages, stale fields from previous requests could have ended up in a
partially parsed new request.

src/lib-http/http-request-parser.c

index f0d73bde5a8939f31f5a2c9cfad9a138b8328fb9..538ae4d616f982fb6d70fed1dc11da82a2ff093f 100644 (file)
@@ -584,5 +584,9 @@ int http_request_parse_next(struct http_request_parser *parser,
        request->header = parser->parser.msg.header;
        request->connection_options = parser->parser.msg.connection_options;
        request->connection_close = parser->parser.msg.connection_close;
+
+       /* reset this state early */
+       parser->request_method = NULL;
+       parser->request_target = NULL;
        return 1;
 }