diff --git a/CHANGELOG.md b/CHANGELOG.md index e5dc0304..f009c151 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,8 @@ * pseudo-plugin added, to enable callbacks also for main programs. Useful for extensions ### Corrected Bugs +* Fixed Segv in nacm write when MERGE and creating object + * Should only be applicable on netconf MERGE and restconf PATCH * Corrected problem with namespace context cache, was not always cleared when adding new subtrees. * Corrected CLI bug with lists of multiple keys (netconf/restconf works). * Worked in 3.10, but broke in 4.0 diff --git a/lib/src/clixon_datastore_write.c b/lib/src/clixon_datastore_write.c index b2e07595..b7e943ff 100644 --- a/lib/src/clixon_datastore_write.c +++ b/lib/src/clixon_datastore_write.c @@ -492,7 +492,7 @@ text_modify(clicon_handle h, } if (x0==NULL){ if (op==OP_MERGE && !permit && xnacm){ - if ((ret = nacm_datanode_write(NULL, x0, x0?NACM_UPDATE:NACM_CREATE, username, xnacm, cbret)) < 0) + if ((ret = nacm_datanode_write(NULL, x1, NACM_CREATE, username, xnacm, cbret)) < 0) goto done; if (ret == 0) goto fail; diff --git a/lib/src/clixon_nacm.c b/lib/src/clixon_nacm.c index 1e17c60f..9af77114 100644 --- a/lib/src/clixon_nacm.c +++ b/lib/src/clixon_nacm.c @@ -342,7 +342,7 @@ nacm_rule_datanode(cxobj *xt, if ((module_rule = xml_find_body(xrule, "module-name")) == NULL) goto nomatch; if (strcmp(module_rule,"*")!=0){ - if ((ys = xml_spec(xr)) == NULL) + if (xr==NULL || (ys = xml_spec(xr)) == NULL) goto nomatch; ymod = ys_module(ys); module = yang_argument_get(ymod);