diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-07-20 22:43:20 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-07-26 02:06:17 +0200 |
commit | ec35efd7f2cea4dcbe0188f0d44cde541803f53e (patch) | |
tree | 2e681a73925d94a109f7a78c2005b299aab8781c /src/corelib/text/qstringalgorithms_p.h | |
parent | ab512adf12a2ba36b51f36d7c998d1cbdcf6505a (diff) |
Fix stringish::simplified() for strings > 2Gi characters
If, after simplification, the result string would have been >2Gi
characters in length, the code returned a shorter string, truncated
mod INT_MAX, because the algorithm had not been ported to qsizetype.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103531
Change-Id: I57cfed34e5c69406f8d3f2913962d006b4bc6bd0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/corelib/text/qstringalgorithms_p.h')
-rw-r--r-- | src/corelib/text/qstringalgorithms_p.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/text/qstringalgorithms_p.h b/src/corelib/text/qstringalgorithms_p.h index 527707b8e7..513e2b8cbc 100644 --- a/src/corelib/text/qstringalgorithms_p.h +++ b/src/corelib/text/qstringalgorithms_p.h @@ -101,7 +101,7 @@ template <typename StringType> struct QStringAlgorithms if (ptr != dst && ptr[-1] == QChar::Space) --ptr; - int newlen = ptr - dst; + qsizetype newlen = ptr - dst; if (isConst && newlen == str.size() && unmodified) { // nothing happened, return the original return str; |