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-05 17:29:26 +0000
commita59221f7461bdd43338227b39f37875d7847afc3 (patch)
tree22eb47a4efb34219c637b146dee73d8c73162155
parent860a9ba6d00adc7927eedf738b6d3ec1afaeeebd (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 635b1f2305..e149cdd166 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -8531,7 +8531,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] == QLatin1Char('L'))
++i;