diff options
author | Joni Poikelin <[email protected]> | 2024-01-23 09:51:01 +0200 |
---|---|---|
committer | Joni Poikelin <[email protected]> | 2024-01-23 14:56:54 +0200 |
commit | 96f1ef1c1c43a965697022f99105c11613129e3d (patch) | |
tree | dc73564041f3e46f89f70e680a50e0683f81a29b | |
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 <[email protected]>
-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 e7dcd3cb9c1..509b2eb7ccb 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); } |