From 389fdd6d8d1f51c026b82a3cb4e2379c3d9debf1 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Fri, 6 May 2022 01:08:19 +0200 Subject: [PATCH] =?UTF-8?q?QXmlStreamReader:=20fix=20integer=20truncation?= =?UTF-8?q?=20(qint64=20=E2=86=92=20int)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don't care about the actual type of oldLineNumber here, we just need it to be of the same type as lineNumber, to avoid truncation, so we use auto. This was already broken in 5.15 (lineNumber was already a qint64). Pick-to: 6.3 6.2 5.15 Change-Id: I68d7e6e91c8122bf426c9c10e8cc91ff55c61a20 Reviewed-by: Thiago Macieira --- src/corelib/serialization/qxmlstream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/serialization/qxmlstream.cpp b/src/corelib/serialization/qxmlstream.cpp index 21ca09057b..be9fcb3356 100644 --- a/src/corelib/serialization/qxmlstream.cpp +++ b/src/corelib/serialization/qxmlstream.cpp @@ -958,7 +958,7 @@ inline uint QXmlStreamReaderPrivate::peekChar() bool QXmlStreamReaderPrivate::scanUntil(const char *str, short tokenToInject) { int pos = textBuffer.size(); - int oldLineNumber = lineNumber; + const auto oldLineNumber = lineNumber; uint c; while ((c = getChar()) != StreamEOF) {