Fixed Segv in nacm write when MERGE and creating object

This commit is contained in:
Olof hagsand 2019-08-09 14:20:38 +02:00
parent 35808c8352
commit a57dbfc6f0
3 changed files with 4 additions and 2 deletions

View file

@ -49,6 +49,8 @@
* pseudo-plugin added, to enable callbacks also for main programs. Useful for extensions * pseudo-plugin added, to enable callbacks also for main programs. Useful for extensions
### Corrected Bugs ### 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 problem with namespace context cache, was not always cleared when adding new subtrees.
* Corrected CLI bug with lists of multiple keys (netconf/restconf works). * Corrected CLI bug with lists of multiple keys (netconf/restconf works).
* Worked in 3.10, but broke in 4.0 * Worked in 3.10, but broke in 4.0

View file

@ -492,7 +492,7 @@ text_modify(clicon_handle h,
} }
if (x0==NULL){ if (x0==NULL){
if (op==OP_MERGE && !permit && xnacm){ 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; goto done;
if (ret == 0) if (ret == 0)
goto fail; goto fail;

View file

@ -342,7 +342,7 @@ nacm_rule_datanode(cxobj *xt,
if ((module_rule = xml_find_body(xrule, "module-name")) == NULL) if ((module_rule = xml_find_body(xrule, "module-name")) == NULL)
goto nomatch; goto nomatch;
if (strcmp(module_rule,"*")!=0){ if (strcmp(module_rule,"*")!=0){
if ((ys = xml_spec(xr)) == NULL) if (xr==NULL || (ys = xml_spec(xr)) == NULL)
goto nomatch; goto nomatch;
ymod = ys_module(ys); ymod = ys_module(ys);
module = yang_argument_get(ymod); module = yang_argument_get(ymod);