]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm-server: http: Changed request parse error into an assertion.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Fri, 27 Oct 2017 07:36:39 +0000 (09:36 +0200)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Fri, 27 Oct 2017 07:39:19 +0000 (09:39 +0200)
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.

src/doveadm/client-connection-http.c

index 5dff28053fb5f11f8d8ba663f271266bea394d86..24db59cf8a5b384c4174a79db3fd88618ea619fe 100644 (file)
@@ -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) {