summaryrefslogtreecommitdiff
path: root/xmlscript
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-04-05 16:19:50 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-04-05 16:19:50 +0200
commit5b32ba4217e88f3f6fab0baaa79988623e55ba0e (patch)
treeb62000d91268e39e690f304886a39685c508b654 /xmlscript
parent3e253963b93330dcd9e38c39de6601dbd43f13e4 (diff)
-fsanitize=nonnull-attribute
Change-Id: Ice9fef5bdfd3e993b1b2ba035cbc971b8dacbe3a
Diffstat (limited to 'xmlscript')
-rw-r--r--xmlscript/source/xml_helper/xml_byteseq.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/xmlscript/source/xml_helper/xml_byteseq.cxx b/xmlscript/source/xml_helper/xml_byteseq.cxx
index 56cc5d29df0c..19bdb0b8e180 100644
--- a/xmlscript/source/xml_helper/xml_byteseq.cxx
+++ b/xmlscript/source/xml_helper/xml_byteseq.cxx
@@ -69,7 +69,9 @@ sal_Int32 BSeqInputStream::readBytes(
if (rData.getLength() != nBytesToRead)
rData.realloc( nBytesToRead );
- memcpy(rData.getArray(), &_seq.data()[_nPos], nBytesToRead);
+ if (nBytesToRead != 0) {
+ memcpy(rData.getArray(), &_seq.data()[_nPos], nBytesToRead);
+ }
_nPos += nBytesToRead;
return nBytesToRead;
}
@@ -145,7 +147,9 @@ Reference< io::XInputStream > SAL_CALL createInputStream( std::vector<sal_Int8>
Reference< io::XInputStream > SAL_CALL createInputStream( const sal_Int8* pData, int len )
{
std::vector<sal_Int8> rInData(len);
- memcpy( rInData.data(), pData, len);
+ if (len != 0) {
+ memcpy( rInData.data(), pData, len);
+ }
return new BSeqInputStream( rInData );
}