summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-05-02 21:17:06 +0100
committerMichael Stahl <michael.stahl@allotropia.de>2022-09-23 12:56:42 +0200
commit4b4a103867a42433f5d8b7aa0abb117ae8f480bf (patch)
tree94fcfadc44fd8330e34f019713fd2ad3aa036631
parentpython3: find the bundled openssl headers (diff)
downloadcore-4b4a103867a42433f5d8b7aa0abb117ae8f480bf.tar.gz
core-4b4a103867a42433f5d8b7aa0abb117ae8f480bf.zip
ofz: Use-of-uninitialized-value
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133717 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit f248b99b6f7f93b5170b4c50d7827fa0dd23421e) Change-Id: I9ca24a135494a49449aec63615b2d945a93e8b27
-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 d0b3a80bfc9d..f5079fa41489 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1119,7 +1119,7 @@ void OutputDevice::GetCaretPositions( const OUString& rStr, long* pCaretXArray,
for( i = 0; i < 2 * nLen; ++i )
if( pCaretXArray[ i ] >= 0 )
break;
- long nXPos = pCaretXArray[ i ];
+ long nXPos = (i < 2 * nLen) ? pCaretXArray[i] : -1;
for( i = 0; i < 2 * nLen; ++i )
{
if( pCaretXArray[ i ] >= 0 )