lotuswordpro/source/filter/lwpsdwfileloader.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit a6b1f367419e2b3645f37b572736f3d504520c16
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Jan 17 10:40:20 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Jan 17 13:09:40 2022 +0100

    ofz: Use-of-uninitialized-value
    
    Change-Id: I77847175d5ad0b2757eb24fcff08a4caf5d77519
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128494
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/lotuswordpro/source/filter/lwpsdwfileloader.cxx 
b/lotuswordpro/source/filter/lwpsdwfileloader.cxx
index 3a7f05bb477a..bcdb7bb018af 100644
--- a/lotuswordpro/source/filter/lwpsdwfileloader.cxx
+++ b/lotuswordpro/source/filter/lwpsdwfileloader.cxx
@@ -77,12 +77,13 @@ LwpSdwFileLoader::~LwpSdwFileLoader() {}
 void LwpSdwFileLoader::CreateDrawObjects(std::vector<rtl::Reference<XFFrame>>* 
pDrawObjVector)
 {
     unsigned char BinSignature[2];
-    m_pStream->ReadBytes(BinSignature, 2);
+    if (m_pStream->ReadBytes(BinSignature, 2) != 2)
+        return;
 
     if (BinSignature[0] != 'S' || BinSignature[1] != 'M')
         return;
 
-    unsigned short nVersion;
+    unsigned short nVersion(0);
     m_pStream->ReadUInt16(nVersion);
 
     m_pStream->Seek(0);

Reply via email to