summaryrefslogtreecommitdiff
path: root/xmlscript/source/xml_helper/xml_byteseq.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmlscript/source/xml_helper/xml_byteseq.cxx')
-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 );
}