summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-07-20 22:16:30 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-04 11:17:11 +0000
commit4c08f71a11d35bcf263967f95797022ba944f9a4 (patch)
treeec5021d4795dbb6e5a55893bf19e1d29d5286d0b
parentcf89e21bde5cebf3329ab88cf8695467d0ece53d (diff)
Fix QString::arg() for format strings > 2Gi characters
The getEscape function truncated the qsizetype position it got from the caller to an int, potentially parsing a previous escape sequence (or, more likely, garbage), by getting the position in the string wrong. Task-number: QTBUG-103531 Change-Id: I3b921c0991d238bbacfe6699c56146fe032134df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 841ff3b73f9951e49b6406007d76302b3f367f55) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/corelib/text/qstring.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index 55500bc526..4ae5eb1060 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -8508,7 +8508,7 @@ static inline char16_t to_unicode(const char c) { return QLatin1Char{c}.unicode(
template <typename Char>
static int getEscape(const Char *uc, qsizetype *pos, qsizetype len, int maxNumber = 999)
{
- int i = *pos;
+ qsizetype i = *pos;
++i;
if (i < len && uc[i] == u'L')
++i;