]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-oauth2: Fix assert panic occurring while skipping ignored object and array fields.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 9 Dec 2018 20:14:29 +0000 (21:14 +0100)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Thu, 21 Mar 2019 08:03:02 +0000 (10:03 +0200)
Fixed by using json_parse_skip(), rather than json_parse_skip_next(). The latter
is not suitable for skipping a value that is already partially parsed by
json_parse_next().

Panic was:

Panic: file json-parser.c: line 668 (json_parse_skip_next): assertion failed: (parser->state == JSON_STATE_OBJECT_COLON || parser->state == JSON_STATE_OBJECT_VALUE || parser->state == JSON_STATE_ARRAY_VALUE || parser->state == JSON_STATE_ARRAY_NEXT)

src/lib-oauth2/oauth2.c

index a5080b97a55f637bb5df0bd61c86d6f4152c7d72..50d4392aa83b3abd197100228915cb2947802ad1 100644 (file)
@@ -26,7 +26,7 @@ oauth2_parse_json(struct oauth2_request *req)
                } else if (type < JSON_TYPE_STRING) {
                        /* this should be last allocation */
                        p_free(req->pool, req->field_name);
-                       json_parse_skip_next(req->parser);
+                       json_parse_skip(req->parser);
                } else {
                        if (!array_is_created(&req->fields))
                                p_array_init(&req->fields, req->pool, 4);