Kaydet (Commit) 1243f89c authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz: detect short read

Change-Id: I1d394e914c4791a2bc3a8f3dbb1cf200e7d528fe
Reviewed-on: https://gerrit.libreoffice.org/44691Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 1c52e61f
...@@ -514,7 +514,7 @@ namespace emfio ...@@ -514,7 +514,7 @@ namespace emfio
if ( nLength ) if ( nLength )
{ {
std::unique_ptr<char[]> pChar(new char[ ( nLength + 1 ) &~ 1 ]); std::unique_ptr<char[]> pChar(new char[ ( nLength + 1 ) &~ 1 ]);
mpInputStream->ReadBytes(pChar.get(), (nLength + 1) &~ 1); nLength = std::min<sal_uInt64>(nLength, mpInputStream->ReadBytes(pChar.get(), (nLength + 1) &~ 1));
OUString aText( pChar.get(), nLength, GetCharSet() ); OUString aText( pChar.get(), nLength, GetCharSet() );
pChar.reset(); pChar.reset();
Point aPosition( ReadYX() ); Point aPosition( ReadYX() );
......
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