From: Stephan Bosch Date: Sun, 9 Dec 2018 20:14:29 +0000 (+0100) Subject: lib-oauth2: Fix assert panic occurring while skipping ignored object and array fields. X-Git-Tag: 2.3.6~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dce9f261864d1eaf995da12e0147f8b5eee59803;p=thirdparty%2Fdovecot%2Fcore.git lib-oauth2: Fix assert panic occurring while skipping ignored object and array fields. 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) --- diff --git a/src/lib-oauth2/oauth2.c b/src/lib-oauth2/oauth2.c index a5080b97a5..50d4392aa8 100644 --- a/src/lib-oauth2/oauth2.c +++ b/src/lib-oauth2/oauth2.c @@ -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);