Skip to content

Commit 9f43f21

Browse files
committed
parser lyb BUGFIX parsing LYB data without context hash checking
To support similar context restrictions to the previous libyang version. Refs #2444
1 parent efe43e3 commit 9f43f21

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/parser_lyb.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,15 +1584,7 @@ lyb_parse_header(struct lylyb_ctx *lybctx)
15841584
/* context hash */
15851585
lyb_read((uint8_t *)&hash, sizeof hash, lybctx);
15861586

1587-
if (!hash) {
1588-
/* fine for no data */
1589-
lybctx->empty_hash = 1;
1590-
} else if (lybctx->ctx && (hash != ly_ctx_get_modules_hash(lybctx->ctx))) {
1591-
/* context is not set if called by lyd_lyb_data_length() */
1592-
LOGERR(lybctx->ctx, LY_EINVAL, "Different current LYB context modules hash compared to the one stored in the "
1593-
"LYB file (0x%08x != 0x%08x).", hash, ly_ctx_get_modules_hash(lybctx->ctx));
1594-
return LY_EINVAL;
1595-
}
1587+
/* skip hash checking to support parsing data with less strict requirements (as in the previous versions) */
15961588

15971589
return LY_SUCCESS;
15981590
}

0 commit comments

Comments
 (0)