diff --git a/src/parser_json.c b/src/parser_json.c index 7f0f2d11d..b5edae907 100644 --- a/src/parser_json.c +++ b/src/parser_json.c @@ -501,6 +501,7 @@ lydjson_data_check_opaq(struct lyd_json_ctx *lydctx, const struct lysc_node *sno LY_ERR ret = LY_SUCCESS; struct lyjson_ctx *jsonctx = lydctx->jsonctx; enum LYJSON_PARSER_STATUS status; + uint32_t *prev_lo, temp_lo = 0; assert(snode); @@ -523,9 +524,12 @@ lydjson_data_check_opaq(struct lyd_json_ctx *lydctx, const struct lysc_node *sno if ((ret = lydjson_value_type_hint(jsonctx, &status, type_hint_p))) { break; } + + prev_lo = ly_temp_log_options(&temp_lo); if (ly_value_validate(NULL, snode, jsonctx->value, jsonctx->value_len, LY_VALUE_JSON, NULL, *type_hint_p)) { ret = LY_ENOT; } + ly_temp_log_options(prev_lo); break; case LYS_LIST: /* lists may not have all its keys */ diff --git a/src/parser_xml.c b/src/parser_xml.c index 219da8cc2..8e9a5dc47 100644 --- a/src/parser_xml.c +++ b/src/parser_xml.c @@ -394,8 +394,9 @@ lydxml_data_skip(struct lyxml_ctx *xmlctx) static LY_ERR lydxml_data_check_opaq(struct lyd_xml_ctx *lydctx, const struct lysc_node **snode) { - LY_ERR ret = LY_SUCCESS; + LY_ERR ret = LY_SUCCESS, r; struct lyxml_ctx *xmlctx = lydctx->xmlctx, pxmlctx; + uint32_t *prev_lo, temp_lo = 0; if (!(lydctx->parse_opts & LYD_PARSE_OPAQ)) { /* only checks specific to opaque nodes */ @@ -420,7 +421,10 @@ lydxml_data_check_opaq(struct lyd_xml_ctx *lydctx, const struct lysc_node **snod if ((*snode)->nodetype & LYD_NODE_TERM) { /* value may not be valid in which case we parse it as an opaque node */ - if (ly_value_validate(NULL, *snode, xmlctx->value, xmlctx->value_len, LY_VALUE_XML, &xmlctx->ns, LYD_HINT_DATA)) { + prev_lo = ly_temp_log_options(&temp_lo); + r = ly_value_validate(NULL, *snode, xmlctx->value, xmlctx->value_len, LY_VALUE_XML, &xmlctx->ns, LYD_HINT_DATA); + ly_temp_log_options(prev_lo); + if (r) { LOGVRB("Parsing opaque term node \"%s\" with invalid value \"%.*s\".", (*snode)->name, (int)xmlctx->value_len, xmlctx->value); *snode = NULL;