Skip to content

Infinite recursion in destructor when document was read by htmlReadDoc #23

Closed
@rkd77

Description

@rkd77
#include <libxml/HTMLparser.h>
#include <libxml++/libxml++.h>
#include <string>

int
main(void)
{
        std::string text = "BLABLA";
        xmlDoc* doc = htmlReadDoc((xmlChar*)text.c_str(), NULL, NULL, HTML_PARSE_RECOVER | HTML_PARSE_NOERROR | HTML_PARSE_NOWARNING);
        // Encapsulate raw libxml document in a libxml++ wrapper
        xmlpp::Document doc1(doc);
        return 0;
}

compile as:
g++ -o test test.cpp $(pkg-config --cflags libxml++-5.0) $(pkg-config --libs libxml++-5.0)

./test segfaults

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions