aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/xmlparser.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/common/xmlparser.h b/common/xmlparser.h
index c3eb68ca78..0f859ecf14 100644
--- a/common/xmlparser.h
+++ b/common/xmlparser.h
@@ -333,16 +333,17 @@ protected:
return parserError("Malformed comment syntax.");
_char = _stream->readByte();
- bool dash = false;
while (_char) {
if (_char == '-') {
- if (dash && _stream->readByte() == '>') {
+ if (_stream->readByte() == '-') {
+
+ if (_stream->readByte() != '>')
+ return parserError("Malformed comment (double-hyphen inside comment body).");
+
_char = _stream->readByte();
return true;
}
-
- dash = !dash;
}
_char = _stream->readByte();