From 8b7e6d6b92108818626e7e3c7e709009b486e083 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sat, 15 Oct 2005 06:12:58 +0000 Subject: [PATCH] add error check to prevent infinite recursion --- stepmania/src/XmlFile.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/stepmania/src/XmlFile.cpp b/stepmania/src/XmlFile.cpp index 41bdce2c04..d17fc74e55 100644 --- a/stepmania/src/XmlFile.cpp +++ b/stepmania/src/XmlFile.cpp @@ -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;