Fixed: [CLI crash if error-info is empty #134](https://github.com/clicon/clixon/issues/134)

This commit is contained in:
Olof hagsand 2020-09-01 16:19:58 +02:00
parent 41ac192362
commit a01fe04613
2 changed files with 3 additions and 1 deletions

View file

@ -38,6 +38,7 @@ Users may have to change how they access the system
### Corrected Bugs ### Corrected Bugs
* Fixed: [CLI crash if error-info is empty #134](https://github.com/clicon/clixon/issues/134)
* Fixed: [Cannot create or modify NACM data node access rule with path using JSON encoding #129](https://github.com/clicon/clixon/issues/129). The evaluation of NACM datanode rule path is assumed to be canonical namespace and cannot be overruled with `xmlns` rules. * Fixed: [Cannot create or modify NACM data node access rule with path using JSON encoding #129](https://github.com/clicon/clixon/issues/129). The evaluation of NACM datanode rule path is assumed to be canonical namespace and cannot be overruled with `xmlns` rules.
* Corrected error message for list min/max-value to comply to RFC 7950: a proper path is now returned, previously only the final list symbol was returned. This error-path is also now exposed in the CLI error message correctly. * Corrected error message for list min/max-value to comply to RFC 7950: a proper path is now returned, previously only the final list symbol was returned. This error-path is also now exposed in the CLI error message correctly.
* Example: `<error-path>/c/a1</error-path>` * Example: `<error-path>/c/a1</error-path>`

View file

@ -1396,7 +1396,8 @@ netconf_err2cb(cxobj *xerr,
cprintf(cberr, "%s ", xml_body(x)); cprintf(cberr, "%s ", xml_body(x));
if ((x=xpath_first(xerr, NULL, "//error-message"))!=NULL) if ((x=xpath_first(xerr, NULL, "//error-message"))!=NULL)
cprintf(cberr, "%s ", xml_body(x)); cprintf(cberr, "%s ", xml_body(x));
if ((x=xpath_first(xerr, NULL, "//error-info"))!=NULL) if ((x=xpath_first(xerr, NULL, "//error-info"))!=NULL &&
xml_child_nr(x) > 0)
clicon_xml2cbuf(cberr, xml_child_i(x,0), 0, 0, -1); clicon_xml2cbuf(cberr, xml_child_i(x,0), 0, 0, -1);
if ((x=xpath_first(xerr, NULL, "//error-app-tag"))!=NULL) if ((x=xpath_first(xerr, NULL, "//error-app-tag"))!=NULL)
cprintf(cberr, ": %s ", xml_body(x)); cprintf(cberr, ": %s ", xml_body(x));