When reading newline separated JSON (array mode), continue parsing even
if the JSON tokener signals success, as another object might follow.
Fixes: FS#3683
Fixes: openwrt#8703
Fixes: openwrt#11649
Fixes: openwrt#12344
Fixes: 8614470 ("main: implement array mode")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
{
obj = parse_json_chunk(tok, array, buf, len, &err);
- if (err == json_tokener_success && !array)
- break;
-
- if (err != json_tokener_continue)
+ if ((err == json_tokener_success && array_mode == false) ||
+ (err != json_tokener_continue && err != json_tokener_success))
break;
}
}