tree data BUGFIX check for invalid LYB data
diff --git a/src/tree_data.c b/src/tree_data.c
index e66ccf1..e09ae27 100644
--- a/src/tree_data.c
+++ b/src/tree_data.c
@@ -1345,7 +1345,7 @@
case LYD_ANYDATA_LYB:
len1 = lyd_lyb_data_length(any1->value.mem);
len2 = lyd_lyb_data_length(any2->value.mem);
- if ((len1 != len2) || memcmp(any1->value.mem, any2->value.mem, len1)) {
+ if ((len1 == -1) || (len2 == -1) || (len1 != len2) || memcmp(any1->value.mem, any2->value.mem, len1)) {
return LY_ENOT;
}
return LY_SUCCESS;