{"action":"created","issue":{"url":"https://api.github.com/repos/CESNET/libnetconf/issues/126","labels_url":"https://api.github.com/repos/CESNET/libnetconf/issues/126/labels{/name}","comments_url":"https://api.github.com/repos/CESNET/libnetconf/issues/126/comments","events_url":"https://api.github.com/repos/CESNET/libnetconf/issues/126/events","html_url":"https://github.com/CESNET/libnetconf/issues/126","id":117318515,"number":126,"title":"Parsing message dump failed...Segmentation fault","user":{"login":"Yangns","id":15865846,"avatar_url":"https://avatars.githubusercontent.com/u/15865846?v=3","gravatar_id":"","url":"https://api.github.com/users/Yangns","html_url":"https://github.com/Yangns","followers_url":"https://api.github.com/users/Yangns/followers","following_url":"https://api.github.com/users/Yangns/following{/other_user}","gists_url":"https://api.github.com/users/Yangns/gists{/gist_id}","starred_url":"https://api.github.com/users/Yangns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yangns/subscriptions","organizations_url":"https://api.github.com/users/Yangns/orgs","repos_url":"https://api.github.com/users/Yangns/repos","events_url":"https://api.github.com/users/Yangns/events{/privacy}","received_events_url":"https://api.github.com/users/Yangns/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-17T09:47:58Z","updated_at":"2015-11-18T06:53:33Z","closed_at":"2015-11-18T06:53:33Z","body":"Hi,\r\nWe have tried giving a request to netopeer without using SSH connection. We inserted a user defined function ```nc_invoke()``` in main() function of server.c. In ```nc_invoke()```, we have written the following code:\r\n```\r\nnc_rpc* x;\r\nnc_rpc** y;\r\nvoid nc_invoke()\r\n{\r\nchar c[]=\"some rpc request\";\r\ny=&x;\r\nx=nc_rpc_build(NULL, c);\r\nnc_session_receive(NULL, 100000, y);\r\n}\r\n```\r\n\r\nHere, the control is going to ```nc_msg_build()``` from ```nc_rpc_build()```. There, in ```nc_msg_build()```, we are getting an error at ```xmlReadMemory()``` : ```nc_msg_build: parsing message dump failed```. \r\nwhen we printed the output of xmlReadMemory(), it returned null value.\r\n\r\nSample request:\r\n```\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<rpc xmlns=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"2\">\r\n  <get />\r\n</rpc>\r\n```\r\n\r\nPlease help us out.\r\nIt would be thankful if you tell us the reason why ```xmlReadMemory()``` is used."},"comment":{"url":"https://api.github.com/repos/CESNET/libnetconf/issues/comments/157626046","html_url":"https://github.com/CESNET/libnetconf/issues/126#issuecomment-157626046","issue_url":"https://api.github.com/repos/CESNET/libnetconf/issues/126","id":157626046,"user":{"login":"rkrejci","id":6471899,"avatar_url":"https://avatars.githubusercontent.com/u/6471899?v=3","gravatar_id":"","url":"https://api.github.com/users/rkrejci","html_url":"https://github.com/rkrejci","followers_url":"https://api.github.com/users/rkrejci/followers","following_url":"https://api.github.com/users/rkrejci/following{/other_user}","gists_url":"https://api.github.com/users/rkrejci/gists{/gist_id}","starred_url":"https://api.github.com/users/rkrejci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rkrejci/subscriptions","organizations_url":"https://api.github.com/users/rkrejci/orgs","repos_url":"https://api.github.com/users/rkrejci/repos","events_url":"https://api.github.com/users/rkrejci/events{/privacy}","received_events_url":"https://api.github.com/users/rkrejci/received_events","type":"User","site_admin":false},"created_at":"2015-11-18T06:53:33Z","updated_at":"2015-11-18T06:53:33Z","body":"It is simple, you are getting NULL, because you are saying to nc_rpc_build() that RPC is NULL. See the [nc_rpc_build() doc](https://rawgit.com/CESNET/libnetconf/master/doc/doxygen/html/db/de9/group__rpc.html#ga5c4348c96b0d5e6a64f94dbbdeaf4100). And neither the rest of your code make any sense. You are using nc_session_receive() (btw, it is a static function and to use it you had to modify libnetconf source code and you should really know what you are doing) with wrong parameters and for some magic reason which is very unclear to me.\r\n\r\nxmlReadMemory is used to build XML tree from string. That's simply its functionality.\r\n"}}