diff options
author | Marc Mutz <marc.mutz@qt.io> | 2022-07-20 22:21:12 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-07-26 01:29:15 +0200 |
commit | 15a80cf8a9d59203f8e2b436a5c804197c044807 (patch) | |
tree | d3c4ed344e85762efb2c4fcee7b21ef3da21d32c /src/corelib/text/qlocale.cpp | |
parent | f9d002ea20e7d5075313e9dcc769ed5348d2b829 (diff) |
Fix QString::arg() for format strings with a huge amount of placeholders
QString::arg()s placeholders are limited to triple-digits, so 1000
different ones. By the same token, the length of any one of them is
bounded to five (%L?\d{,3}). But the total possible length of escape
sequences is _not_ 5000B, because there's no limit on the number of
_equal_ placeholders, so a format string where the total escape sequence
length exceeded 2Gi characters, e.g.
QString("%L100").repeated(INT_MAX/5 + 1).arg(42);
would produce corrupt data.
Pick-to: 6.4 6.3
Task-number: QTBUG-103531
Change-Id: Id27ee02579387efcbb5928de1eb9acbeb9f954c9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/text/qlocale.cpp')
0 files changed, 0 insertions, 0 deletions