Kaydet (Commit) d2834a80 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

forcepoint #25 ensure null termination

Change-Id: I37f4787fb5772e959c45280d9650adcc15591033
Reviewed-on: https://gerrit.libreoffice.org/51130Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMichael Stahl <mstahl@redhat.com>
(cherry picked from commit 5a6a1e93)
üst dbb64d97
...@@ -274,11 +274,15 @@ bool JobData::constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, Jo ...@@ -274,11 +274,15 @@ bool JobData::constructFromStreamBuffer( const void* pData, sal_uInt32 bytes, Jo
if( rJobData.m_pParser ) if( rJobData.m_pParser )
{ {
rJobData.m_aContext.setParser( rJobData.m_pParser ); rJobData.m_aContext.setParser( rJobData.m_pParser );
const sal_uInt64 nBytes = bytes - aStream.Tell(); sal_uInt64 nBytes = bytes - aStream.Tell();
std::unique_ptr<char[]> pRemain(new char[bytes - aStream.Tell()]); std::vector<char> aRemain(nBytes+1);
aStream.ReadBytes( pRemain.get(), nBytes ); nBytes = aStream.ReadBytes(aRemain.data(), nBytes);
rJobData.m_aContext.rebuildFromStreamBuffer( pRemain.get(), nBytes ); if (nBytes)
bContext = true; {
aRemain[nBytes] = 0;
rJobData.m_aContext.rebuildFromStreamBuffer(aRemain.data(), nBytes);
bContext = true;
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment