Skip to content

Commit

Permalink
doveadm-server: http: Changed request parse error into an assertion.
Browse files Browse the repository at this point in the history
The condition can never occur when json-parser and the request parsing state machine are behaving correctly.
At that point only an object key can be returned; the client cannot cause it to return anything else.
  • Loading branch information
stephanbosch committed Oct 27, 2017
1 parent 664503c commit 2ccd63d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/doveadm/client-connection-http.c
Expand Up @@ -441,9 +441,7 @@ doveadm_http_handle_json_v1(struct client_request_http *req,
req->parse_state = CLIENT_REQUEST_PARSE_CMD_ID;
return TRUE;
}
// can happen...
if (type != JSON_TYPE_OBJECT_KEY && type != JSON_TYPE_STRING)
return FALSE;
i_assert(type == JSON_TYPE_OBJECT_KEY);
/* go hunting */
found = FALSE;
array_foreach_modifiable(&req->pargv, par) {
Expand Down

0 comments on commit 2ccd63d

Please sign in to comment.