From 4da2f90473e3bdbbb9a54f62afa0256be8319411 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Mon, 3 Feb 2025 10:16:36 -0400 Subject: [PATCH] MT#55283 skip unparsed flags objects The parser currently relies on the appropriate parsing functions (dict_iter, list_iter) to be called to advance into and back out of any sub-objects containd within the flags string. However, if an unknown key is encountered, no parsing functions would be invoked, resulting in the parser not skipping over the sub-object and subsequently a stray error message in the log. Work around this by detecting unparsed objects and then using a dummy list_iter to return to a good parsing position. Change-Id: I908aff8b9be8d12644a9faea0dcf3bf3535faf32 --- daemon/control_ng_flags_parser.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daemon/control_ng_flags_parser.c b/daemon/control_ng_flags_parser.c index 749de849f..672647122 100644 --- a/daemon/control_ng_flags_parser.c +++ b/daemon/control_ng_flags_parser.c @@ -224,6 +224,8 @@ static bool rtpp_dict_iter(const ng_parser_t *parser, rtpp_pos *pos, break; // nothing left callback(parser, &key, pos, arg); + if (rtpp_is_dict_list(pos)) + rtpp_list_iter(parser, pos, NULL, NULL, NULL); if (end) break; goto next; @@ -434,6 +436,8 @@ generic: else { rtpp_pos pos = { .cur = val, .remainder = remainder }; call_ng_main_flags(&dummy_parser, &key, &pos, out); + if (rtpp_is_dict_list(&pos)) + rtpp_list_iter(&dummy_parser, &pos, NULL, NULL, NULL); remainder = pos.remainder; }