Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix a coredump for api 'lyd_parse_xml' when action has no namespace #1133

Merged
merged 1 commit into from
Jun 30, 2020

Conversation

fredgan
Copy link
Contributor

@fredgan fredgan commented Jun 30, 2020

Hi,Michal,
there is a coredump in api lyd_parse_xml when action has no namespace in XML data, and I try to fix it, please review it , thanks.

my sample yang module, XML data and test it with yanglint (the latest version 1.8.7) are as follows:
the yang module,mod.yang :

module mod {
    prefix abc;
    namespace "urn:cesnet:mod";

    yang-version 1.1;

    container action {
        action act {
            input {
                leaf l {
                    type string;
                }
            }

            output {
                leaf l2 {
                    type string;
                }
            }
        }
    }
}

the XML data,data.xml:

<action>
  <act>
    <l>test</l>
  </act>
</action>

using yanglint with the command (yanglint -t rpc -f xml mod.yang data.xml) , the result appears a coredump

root@oss-0007:/home/sample_test# yanglint -v
yanglint SO 1.8.7
root@oss-0007:/home/sample_test# yanglint -t rpc -f xml mod.yang data.xml
Segmentation fault (core dumped)
root@oss-0007:/home/sample_test#

@michalvasko
Copy link
Member

Hi Fred,
right, seems like a simple fix and the correct one. Thanks, merging.

Regards,
Michal

@michalvasko michalvasko merged commit 53d7689 into CESNET:devel Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants