summaryrefslogtreecommitdiff
path: root/core/fxcrt/xml/cfx_xmlparser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/xml/cfx_xmlparser.cpp')
-rw-r--r--core/fxcrt/xml/cfx_xmlparser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/fxcrt/xml/cfx_xmlparser.cpp b/core/fxcrt/xml/cfx_xmlparser.cpp
index 115b3e7e92..d66d980f38 100644
--- a/core/fxcrt/xml/cfx_xmlparser.cpp
+++ b/core/fxcrt/xml/cfx_xmlparser.cpp
@@ -134,7 +134,9 @@ bool CFX_XMLParser::DoSyntaxParse(CFX_XMLDocument* doc) {
current_parser_state = FDE_XmlSyntaxState::Node;
}
} else {
- if (node_type_stack.size() <= 0 && ch && !FXSYS_iswspace(ch))
+ // Fail if there is text outside of the root element, ignore
+ // whitespace/null.
+ if (node_type_stack.empty() && ch && !FXSYS_iswspace(ch))
return false;
ProcessTextChar(ch);
current_buffer_idx++;