Did not check for missing list keys in validate. [Key of a list isn't mandatory](https://github.com/clicon/clixon/issues/73)

This commit is contained in:
Olof hagsand 2019-02-13 18:19:33 +01:00
parent 9fc8ac2e8e
commit 057f4835db
6 changed files with 52 additions and 10 deletions

View file

@ -252,11 +252,15 @@ xml_cmp(const void* arg1,
cvk = y1->ys_cvec; /* Use Y_LIST cache, see ys_populate_list() */
cvi = NULL;
while ((cvi = cvec_each(cvk, cvi)) != NULL) {
keyname = cv_string_get(cvi);
b1 = xml_find_body(x1, keyname);
b2 = xml_find_body(x2, keyname);
if ((equal = strcmp(b1,b2)) != 0)
goto done;
keyname = cv_string_get(cvi); /* operational data may have NULL keys*/
if ((b1 = xml_find_body(x1, keyname)) == NULL)
equal = -1;
else if ((b2 = xml_find_body(x2, keyname)) == NULL)
equal = 1;
else{
if ((equal = strcmp(b1,b2)) != 0)
goto done;
}
}
equal = 0;
break;