Commit 0f8bf497 authored by Pavel Vainerman's avatar Pavel Vainerman

(UniXML): fixed SIGSEGV in iterator::findName

parent 0772b39c
......@@ -598,6 +598,9 @@ bool UniXML_iterator::findName( const std::string& nodename, const std::string&
{
fnode = this->findX(fnode, nodename, deepfind);
if( !fnode )
return false;
if ( searchname == UniXML::getProp(fnode, "name") )
{
curNode = fnode;
......
......@@ -97,6 +97,10 @@ TEST_CASE("UniXML::iterator", "[unixml][iterator][basic]" )
--it;
CHECK( it.getName() == "UserData" );
UniXML::iterator it_bad = uxml.begin();
REQUIRE_FALSE( it_bad.findName("UnknownNode","NOTFOUND") );
REQUIRE_FALSE( !it_bad );
it = uxml.begin();
CHECK( it.findName("TestNode", "TestNode1") != 0 );
it = uxml.begin();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment