From e510b3089024e451b57d6150f6f1a5a34594e376 Mon Sep 17 00:00:00 2001 From: Mike Kaganski Date: Tue, 10 Aug 2021 18:26:23 +0200 Subject: Use nStringSize instead of nStringOff nStringSize is the actual size of the string block, and is the correct end position to use to calculate last string length. nStringOff is not updated during load, so using it makes no sense here. It was this way ever since 039dbbcb9688971a85b1791f60a55693ff3ba261. Change-Id: I4fad1bdd6ed4af9dd7d29b5438ec23db0b815806 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120243 Reviewed-by: Mike Kaganski Tested-by: Mike Kaganski --- basic/source/classes/image.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'basic/source/classes/image.cxx') diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index 73d65e98eab9..50ccbfa09669 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -655,7 +655,7 @@ OUString SbiImage::GetString( short nId, SbxDataType *eType ) const sal_uInt32 nOff = mvStringOffsets[ nId - 1 ]; sal_Unicode* pStr = pStrings.get() + nOff; - sal_uInt32 nNextOff = (nId < short(mvStringOffsets.size())) ? mvStringOffsets[ nId ] : nStringOff; + sal_uInt32 nNextOff = (nId < short(mvStringOffsets.size())) ? mvStringOffsets[ nId ] : nStringSize; sal_uInt32 nLen = nNextOff - nOff - 1; // #i42467: Special treatment for vbNullChar if (*pStr == 0) -- cgit