[xmlsec] About xmlParseInNodeContext() in libxml2.

Aleksey Sanin aleksey at aleksey.com
Tue Sep 14 23:44:03 PDT 2004


Can you try to insert the two lines from bellow? If it will not work
then it would be a good idea to file a bug against LibXML2

http://xmlsoft.org/bugs.html

I'll try to look at this more this weekend (sorry, but I doubt that I'll
have time before that).

Aleksey

> ===========================================================================================
>     char *buffer = "<xsi:getsumReturn xsi:type=\"xsd:int\">9</xsi:getsumReturn>";
> 
>     xmlInitParser();
>     LIBXML_TEST_VERSION
>     xmlLoadExtDtdDefaultValue = XML_DETECT_IDS | XML_COMPLETE_ATTRS;
>     xmlSubstituteEntitiesDefault(1);
> 
>     /* load template */
>     doc = xmlParseFile("soap.xml");
>     if ((doc == NULL) || (xmlDocGetRootElement(doc) == NULL)){
>         fprintf(stderr, "Error: unable to parse file \"%s\"\n", "soap.xml");
>         goto done;
>     }
> 
>     ret = xmlParseInNodeContext(xmlDocGetRootElement(doc), buffer, xmlStrlen(buffer), XML_PARSE_NOENT, &encNode);
>     if(ret < 0) {
>         fprintf(stderr, "Error: xmlParseInNodeContext.\n");
>         goto done;
>     }
> 

AS ====> xmlUnlinkNode(encNode);
AS ====> xmlSetTreeDoc(encNode, doc);

>     xmlAddChild(xmlDocGetRootElement(doc), encNode);
>     xmlDocDump(stdout, doc);
> 
>     xmlFreeDoc(doc);  <----- The error : Segmentation fault occur!


More information about the xmlsec mailing list