forked from qt-creator/qt-creator
fix read beyond eol on missing expansion terminator
now we uniformly increment the read pointer only if we encountered a terminator (which also implies that we were not at non-eol yet). Task-number: QTCREATORBUG-5022 Change-Id: If4a4e7aec7423684297393fa10e50a69773b2048 Reviewed-on: http://codereview.qt.nokia.com/222 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
This commit is contained in:
@@ -515,7 +515,6 @@ bool ProFileParser::read(ProFile *pro, const QString &in)
|
|||||||
goto newWord;
|
goto newWord;
|
||||||
}
|
}
|
||||||
if (term) {
|
if (term) {
|
||||||
cur++;
|
|
||||||
checkTerm:
|
checkTerm:
|
||||||
if (c != term) {
|
if (c != term) {
|
||||||
parseError(fL1S("Missing %1 terminator [found %2]")
|
parseError(fL1S("Missing %1 terminator [found %2]")
|
||||||
@@ -523,9 +522,9 @@ bool ProFileParser::read(ProFile *pro, const QString &in)
|
|||||||
.arg(c ? QString(c) : QString::fromLatin1("end-of-line")));
|
.arg(c ? QString(c) : QString::fromLatin1("end-of-line")));
|
||||||
pro->setOk(false);
|
pro->setOk(false);
|
||||||
m_inError = true;
|
m_inError = true;
|
||||||
if (c)
|
|
||||||
cur--;
|
|
||||||
// Just parse on, as if there was a terminator ...
|
// Just parse on, as if there was a terminator ...
|
||||||
|
} else {
|
||||||
|
cur++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
joinToken:
|
joinToken:
|
||||||
@@ -585,7 +584,7 @@ bool ProFileParser::read(ProFile *pro, const QString &in)
|
|||||||
finalizeCall(tokPtr, buf, ptr, theargc);
|
finalizeCall(tokPtr, buf, ptr, theargc);
|
||||||
goto nextItem;
|
goto nextItem;
|
||||||
} else if (term == '}') {
|
} else if (term == '}') {
|
||||||
c = (cur == end) ? 0 : *cur++;
|
c = (cur == end) ? 0 : *cur;
|
||||||
goto checkTerm;
|
goto checkTerm;
|
||||||
} else {
|
} else {
|
||||||
Q_ASSERT(!term);
|
Q_ASSERT(!term);
|
||||||
|
|||||||
Reference in New Issue
Block a user