diff options
author | Joni Poikelin <joni.poikelin@qt.io> | 2024-01-23 09:51:01 +0200 |
---|---|---|
committer | Joni Poikelin <joni.poikelin@qt.io> | 2024-01-23 14:56:54 +0200 |
commit | 96f1ef1c1c43a965697022f99105c11613129e3d (patch) | |
tree | dc73564041f3e46f89f70e680a50e0683f81a29b /src/gui/text | |
parent | 3fd49e95a9db3f4c6805c7fcf85fbebe1d6463d0 (diff) |
Fix out of bounds access during QTextDocument cloning
Fixes: QTBUG-120962
Pick-to: 6.5 6.6 6.7
Change-Id: Ib2a35acd5a0d673b39556a4aa930e37eb40b39b2
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qtextformat.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index e7dcd3cb9c..509b2eb7cc 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -3993,7 +3993,7 @@ bool QTextFormatCollection::hasFormatCached(const QTextFormat &format) const int QTextFormatCollection::objectFormatIndex(int objectIndex) const { - if (objectIndex == -1) + if (objectIndex == -1 || objectIndex >= objFormats.size()) return -1; return objFormats.at(objectIndex); } |