add error check to prevent infinite recursion

This commit is contained in:
Glenn Maynard
2005-10-15 06:12:58 +00:00
parent 9bf28a134c
commit 8b7e6d6b92
+13
View File
@@ -184,6 +184,19 @@ unsigned XNode::LoadAttributes( const CString &xml, PARSEINFO *pi, unsigned iOff
iEnd = xml.find_first_of( " >", iOffset );
}
if( iEnd == xml.npos )
{
// error
if( !pi->error_occur )
{
pi->error_occur = true;
pi->error_pointer = xml;
pi->error_code = PIE_ATTR_NO_VALUE;
pi->error_string = ssprintf( "<%s> attribute text: couldn't find matching quote", sName.c_str() );
}
return string::npos;
}
bool trim = pi->trim_value;
SetString( xml, iOffset, iEnd, &sValue, trim );
iOffset = iEnd;