From: Stephan Bosch Date: Mon, 8 Feb 2016 21:49:28 +0000 (+0100) Subject: lib-http: request parser: Made sure that partially parsed requests never have stale... X-Git-Tag: 2.2.22.rc1~192 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba9528fee8773980239901d99667c54a6d2c8132;p=thirdparty%2Fdovecot%2Fcore.git lib-http: request parser: Made sure that partially parsed requests never have stale string values. 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. --- diff --git a/src/lib-http/http-request-parser.c b/src/lib-http/http-request-parser.c index f0d73bde5a..538ae4d616 100644 --- a/src/lib-http/http-request-parser.c +++ b/src/lib-http/http-request-parser.c @@ -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; }