diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2019-10-25 15:14:47 +0300 |
---|---|---|
committer | Olivier Goffart <olivier@woboq.com> | 2019-10-28 12:30:18 +0300 |
commit | 72b886fe87c0778b7f77727da34b697a0c2c96cc (patch) | |
tree | 0d7d66a51d5337fc224f3b546156b6e5c3693025 /src/gui/updater | |
parent | 54e374c66456760f4bd396aaeeb99074be0ee2ec (diff) |
Updater: Fix crash when there is an XML error
The problem was accessing the lines with an off by one error, while printing
the log.
Other problem included the fact that QDebug added spaces, quotes, and other
things which made the error lot look right in the console.
Issue #7545
Diffstat (limited to 'src/gui/updater')
-rw-r--r-- | src/gui/updater/updateinfo.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/updater/updateinfo.cpp b/src/gui/updater/updateinfo.cpp index 97a420e97..ace261c29 100644 --- a/src/gui/updater/updateinfo.cpp +++ b/src/gui/updater/updateinfo.cpp @@ -88,9 +88,9 @@ UpdateInfo UpdateInfo::parseString(const QString &xml, bool *ok) int errorLine, errorCol; QDomDocument doc; if (!doc.setContent(xml, false, &errorMsg, &errorLine, &errorCol)) { - qCCritical(lcUpdater) << errorMsg << " at " << errorLine << "," << errorCol; - qCCritical(lcUpdater()) << "->" << xml.splitRef("\n")[errorLine] << "<-\n" - << QStringLiteral(" ").repeated(2 + errorCol - 1) << "^\n" + qCCritical(lcUpdater).noquote().nospace() << errorMsg << " at " << errorLine << "," << errorCol + << "\n" << xml.splitRef("\n").value(errorLine-1) << "\n" + << QString(" ").repeated(errorCol - 1) << "^\n" << "->" << xml << "<-"; if (ok) *ok = false; |