Skip to content

Commit

Permalink
lib-http: response parser: Always clear response to prevent referring…
Browse files Browse the repository at this point in the history
… to stale data.
  • Loading branch information
stephanbosch authored and GitLab committed Feb 15, 2017
1 parent 5a71074 commit 88ead42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib-http/http-response-parser.c
Expand Up @@ -304,6 +304,8 @@ int http_response_parse_next(struct http_response_parser *parser,
time_t retry_after = (time_t)-1;
int ret;

i_zero(response);

/* make sure we finished streaming payload from previous response
before we continue. */
if ((ret = http_message_parse_finish_payload(&parser->parser)) <= 0) {
Expand Down Expand Up @@ -387,7 +389,6 @@ int http_response_parse_next(struct http_response_parser *parser,

parser->state = HTTP_RESPONSE_PARSE_STATE_INIT;

i_zero(response);
response->status = parser->response_status;
response->reason = parser->response_reason;
response->version_major = parser->parser.msg.version_major;
Expand Down

0 comments on commit 88ead42

Please sign in to comment.