summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-22 09:34:03 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-07-22 16:26:18 +0200
commit7c6d6e30c09756c6daf9961995356b5e0805b107 (patch)
tree8df1e7959fe8b22868cd7976748fc08eb0b8a5a7 /sc
parente1042be85252483dc33efb0f35ac267ac24ecf67 (diff)
cid#1242892 Untrusted value as argument
Change-Id: Ie08f75468fc7acbdf8b89496c750e5fec6d19f0d Reviewed-on: https://gerrit.libreoffice.org/76103 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xistream.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xistream.cxx b/sc/source/filter/excel/xistream.cxx
index a17170fdff26..8e48027cdf1b 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -835,8 +835,6 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit )
sal_uInt16 nCharsLeft = nChars;
sal_uInt16 nReadSize;
- std::unique_ptr<sal_Unicode[]> pcBuffer(new sal_Unicode[ nCharsLeft + 1 ]);
-
while( IsValid() && (nCharsLeft > 0) )
{
if( b16Bit )
@@ -848,6 +846,8 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, bool b16Bit )
else
nReadSize = GetMaxRawReadSize( nCharsLeft );
+ std::unique_ptr<sal_Unicode[]> pcBuffer(new sal_Unicode[nReadSize + 1]);
+
sal_Unicode* pcUniChar = pcBuffer.get();
sal_Unicode* pcEndChar = pcBuffer.get() + nReadSize;