summaryrefslogtreecommitdiff
path: root/vcl/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-04-12 08:45:23 +0100
committerAndras Timar <andras.timar@collabora.com>2022-04-14 13:55:18 +0200
commite06274e4f76deddb59b4ca808bc5c7fa85bca61b (patch)
tree3610ae413551a3ea8ee8ebf13b3c33cbb9b5dff8 /vcl/source
parente1179893ff4477e206850e0c2ed55cd372b8532f (diff)
ofz: Use-of-uninitialized-value
Change-Id: I87cfad2da9b90bc4487dc4deb2fda5bb31a6b763 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132856 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'vcl/source')
-rw-r--r--vcl/source/outdev/text.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 3d773e56d488..8825530e4d76 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1775,7 +1775,7 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const tools::Recta
tools::Long nMnemonicX = 0;
tools::Long nMnemonicY = 0;
DeviceCoordinate nMnemonicWidth = 0;
- if ( nMnemonicPos != -1 )
+ if (nMnemonicPos != -1 && nMnemonicPos < aStr.getLength())
{
std::unique_ptr<sal_Int32[]> const pCaretXArray(new sal_Int32[2 * aStr.getLength()]);
/*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray.get(), 0, aStr.getLength() );