parser json BUGFIX infinite loop in multi-error parsing
diff --git a/src/parser_json.c b/src/parser_json.c
index 55af307..71167d8 100644
--- a/src/parser_json.c
+++ b/src/parser_json.c
@@ -1542,8 +1542,19 @@
if (r == LY_ENOT) {
/* data parsed */
goto cleanup;
+ } else if ((r == LY_EVALID) && (lydctx->val_opts & LYD_VALIDATE_MULTI_ERROR)) {
+ rc = r;
+
+ /* skip the invalid data */
+ if ((r = lydjson_data_skip(lydctx->jsonctx))) {
+ rc = r;
+ }
+ goto cleanup;
+ } else if (r) {
+ /* error */
+ rc = r;
+ goto cleanup;
}
- LY_CHECK_ERR_GOTO(r, rc = r, cleanup);
if (!snode) {
/* we will not be parsing it as metadata */