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

Question about issue 1123 #1282

Closed
Tanco-K opened this issue Nov 17, 2020 · 2 comments
Closed

Question about issue 1123 #1282

Tanco-K opened this issue Nov 17, 2020 · 2 comments

Comments

@Tanco-K
Copy link

Tanco-K commented Nov 17, 2020

Hi!

I see that issue-1123 modified lyxml_correct_elem_ns
code:

        if (iter->content[0] && copy_ns) {
            lyxml_correct_content_ns(ctx, iter, orig);
        }

When trying to send RPC like this:

<?xml version="1.0" encoding="utf-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="19">
<edit-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <target>
    <running/>
  </target>
  <config>
    <test1 xmlns="urn:com:test">
      <abc>
        <users>
          <user>
            <userstr>******<online-num>******</online-num>
            </userstr>
          </user>
        </users>
      </abc>
    </test1>
  </config>
</edit-config>
</rpc>

=================
it cause coredump:

(gdb) bt
#0  0xed2ad9d2 in lyxml_correct_elem_ns (ctx=<optimized out>, elem=<optimized out>, orig=<optimized out>, copy_ns=<optimized out>, correct_attrs=<optimized out>)
    at libyang/src/xml.c:243

#1  0xed0d878e in xml_parse_data (ctx=ctx@entry=0xeb74a138, xml=xml@entry=0xe978d168, parent=<optimized out>, first_sibling=<optimized out>, prev=<optimized out>, options=<optimized out>, unres=<optimized out>, result=<optimized out>, 
    act_notif=<optimized out>, yang_data_name=<optimized out>) at libyang/src/parser_xml.c:506

#2  0xed0d7fce in xml_parse_data (ctx=ctx@entry=0xeb74a138, xml=xml@entry=0xe97843e8, parent=parent@entry=0x0, first_sibling=<optimized out>, prev=<optimized out>, options=<optimized out>, unres=<optimized out>, 
    result=<optimized out>, act_notif=<optimized out>, yang_data_name=<optimized out>) at libyang/src/parser_xml.c:554

#3  0xed0dc3db in lyd_parse_xml (ctx=<optimized out>, root=<optimized out>, options=528) at libyang/src/parser_xml.c:732

=============================
it accessed null-pointer : if (iter->content[0]

 p *(struct lyxml_elem *)iter
$9 = {flags = 1 '\001', parent = 0xe975db28, attr = 0x0, child = 0xe975dc28, next = 0x0, prev = 0xe975dba8, name = 0xe9ab9268 "userstr", ns = 0xea7052a8, content = 0x0}
michalvasko added a commit that referenced this issue Nov 18, 2020
@michalvasko
Copy link
Member

Okay, should be fixed.

@Tanco-K
Copy link
Author

Tanco-K commented Nov 18, 2020

ok,that's good!:)

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

No branches or pull requests

2 participants