Prevent while() from causing potential infinite loops

If xml files don't have proper close tags, don't generate an infinite
loop in our library.
This commit is contained in:
Debao Zhang
2013-12-12 15:50:45 +08:00
parent 39483f77d7
commit 11e8d7c48a
8 changed files with 44 additions and 48 deletions
+1 -1
View File
@@ -143,7 +143,7 @@ DocPropsCore DocPropsCore::loadFromXmlFile(QIODevice *device)
const QString dc = QStringLiteral("http://purl.org/dc/elements/1.1/");
const QString dcterms = QStringLiteral("http://purl.org/dc/terms/");
while(!reader.atEnd()) {
while (!reader.atEnd()) {
QXmlStreamReader::TokenType token = reader.readNext();
if (token == QXmlStreamReader::StartElement) {
const QStringRef nsUri = reader.namespaceUri();