Skip to content

Commit

Permalink
Fixed: [CLI crash if error-info is empty #134](#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
olofhagsand committed Sep 1, 2020
1 parent 41ac192 commit a01fe04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: `<error-path>/c/a1</error-path>`
Expand Down
3 changes: 2 additions & 1 deletion lib/src/clixon_netconf_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit a01fe04

Please sign in to comment.