From b7c9b0c944378ccf373d9daf0dac62dc81a7930e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 1 Apr 2020 14:05:09 +0300 Subject: fixes #2243 (Jabber: buggy OpenFire stanzas drive Miranda crazy) more information here: https://issues.igniterealtime.org/browse/OF-870 --- src/mir_core/src/tinyxml2.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/mir_core') diff --git a/src/mir_core/src/tinyxml2.cpp b/src/mir_core/src/tinyxml2.cpp index b4ece2f203..919ffa30bd 100644 --- a/src/mir_core/src/tinyxml2.cpp +++ b/src/mir_core/src/tinyxml2.cpp @@ -1917,11 +1917,17 @@ char* XMLElement::ParseAttributes( char* p, int* curLineNumPtr ) const int attrLineNum = attrib->_parseLineNum; p = attrib->ParseDeep( p, _document->ProcessEntities(), curLineNumPtr ); - if ( !p || Attribute( attrib->Name() ) ) { + if ( !p ) { DeleteAttribute( attrib ); _document->SetError( XML_ERROR_PARSING_ATTRIBUTE, attrLineNum, "XMLElement name=%s", Name() ); return 0; } + + if (Attribute(attrib->Name())) { + DeleteAttribute(attrib); + continue; + } + // There is a minor bug here: if the attribute in the source xml // document is duplicated, it will not be detected and the // attribute will be doubly added. However, tracking the 'prevAttribute' -- cgit v1.2.3