diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-11-13 17:00:55 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-11-13 21:26:07 +0100 |
commit | 1243f89c6b90f95527104d38ed4e015a69abd1bd (patch) | |
tree | 8ebd825ae79851fe4b1d8c66f726a89dbeb6a858 /emfio | |
parent | 1c52e61fdc48971387254d5c135e613fa42f9df8 (diff) |
ofz: detect short read
Change-Id: I1d394e914c4791a2bc3a8f3dbb1cf200e7d528fe
Reviewed-on: https://gerrit.libreoffice.org/44691
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'emfio')
-rw-r--r-- | emfio/source/reader/wmfreader.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index 1d0ee83709fc..b27b49e307f7 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -514,7 +514,7 @@ namespace emfio if ( nLength ) { 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() ); pChar.reset(); Point aPosition( ReadYX() ); |