diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-07-20 22:16:30 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-08-04 03:35:36 +0200 |
commit | 841ff3b73f9951e49b6406007d76302b3f367f55 (patch) | |
tree | 3db40fe49494ca17e7944c5643501ff99facf2c4 /src/corelib/text | |
parent | 753079b7074b06d237a0ae7a58281c28df134fc0 (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.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103531
Change-Id: I3b921c0991d238bbacfe6699c56146fe032134df
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/text')
-rw-r--r-- | src/corelib/text/qstring.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 9a8620cc1c..5369e1c6cb 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -8521,7 +8521,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; |