diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ba61c41a..32554c404 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ Users may have to change how they access the system ### 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. * 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: `/c/a1` diff --git a/lib/src/clixon_netconf_lib.c b/lib/src/clixon_netconf_lib.c index 8492a89eb..d98629875 100644 --- a/lib/src/clixon_netconf_lib.c +++ b/lib/src/clixon_netconf_lib.c @@ -1396,7 +1396,8 @@ netconf_err2cb(cxobj *xerr, cprintf(cberr, "%s ", xml_body(x)); if ((x=xpath_first(xerr, NULL, "//error-message"))!=NULL) 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); if ((x=xpath_first(xerr, NULL, "//error-app-tag"))!=NULL) cprintf(cberr, ": %s ", xml_body(x));