sw/source/filter/ww8/wrtww8.hxx   |    2 +-
 sw/source/filter/ww8/wrtww8gr.cxx |   10 ++++------
 vcl/source/filter/jpeg/jpegc.cxx  |    3 ++-
 3 files changed, 7 insertions(+), 8 deletions(-)

New commits:
commit 0d32c94b7ec01e8e1bb4b6d0d1f4f092260a6b00
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Jun 2 12:10:27 2024 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sun Jun 2 22:46:15 2024 +0200

    cid#1602450 Dereference after null check
    
    Change-Id: I1953e75066d008f2d4f905e4419752278f73c908
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168343
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index e69d35e07c7a..000ea3580b20 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -1090,7 +1090,7 @@ public:
     void OutGrf(const ww8::Frame &rFrame);
     bool TestOleNeedsGraphic(const SwAttrSet& rSet, rtl::Reference<SotStorage> 
const& xOleStg,
                              const rtl::Reference<SotStorage>& xObjStg, 
OUString const& rStorageName,
-                             SwOLENode* pOLENd);
+                             SwOLENode& rOLENd);
 
     virtual void AppendBookmarks( const SwTextNode& rNd, sal_Int32 
nCurrentPos, sal_Int32 nLen, const SwRedlineData* pRedlineData = nullptr ) 
override;
     virtual void AppendBookmark( const OUString& rName ) override;
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx 
b/sw/source/filter/ww8/wrtww8gr.cxx
index 08790a50b372..ae2b51f40b24 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -85,7 +85,7 @@ void WW8Export::OutputGrfNode( const SwGrfNode& /*rNode*/ )
 
 bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet, 
rtl::Reference<SotStorage> const& xOleStg,
                                     const rtl::Reference<SotStorage>& xObjStg,
-                                    OUString const& rStorageName, SwOLENode* 
pOLENd)
+                                    OUString const& rStorageName, SwOLENode& 
rOLENd)
 {
     bool bGraphicNeeded = false;
     SfxItemIter aIter( rSet );
@@ -127,9 +127,7 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet, 
rtl::Reference<SotSto
         Graphic aGraph(aWMF);
 
         ErrCode nErr = ERRCODE_NONE;
-        sal_Int64 nAspect = embed::Aspects::MSOLE_CONTENT;
-        if ( pOLENd )
-            nAspect = pOLENd->GetAspect();
+        sal_Int64 nAspect = rOLENd.GetAspect();
         rtl::Reference<SdrOle2Obj> pRet = 
SvxMSDffManager::CreateSdrOLEFromStorage(
             *m_rDoc.getIDocumentDrawModelAccess().GetOrCreateDrawModel(),
             rStorageName,
@@ -146,7 +144,7 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet, 
rtl::Reference<SotSto
 
         if (pRet)
         {
-            uno::Reference< embed::XEmbeddedObject > xObj = 
pOLENd->GetOLEObj().GetOleRef();
+            uno::Reference< embed::XEmbeddedObject > xObj = 
rOLENd.GetOLEObj().GetOleRef();
             if ( xObj.is() )
             {
                 std::unique_ptr<SvStream> pGraphicStream;
@@ -288,7 +286,7 @@ void WW8Export::OutputOLENode( const SwOLENode& rOLENode )
                 m_pParentFrame->GetFrameFormat().GetAttrSet();
             bEndCR = false;
             bGraphicNeeded = TestOleNeedsGraphic(rSet,
-                xOleStg, xObjStg, sStorageName, 
const_cast<SwOLENode*>(&rOLENode));
+                xOleStg, xObjStg, sStorageName, 
const_cast<SwOLENode&>(rOLENode));
         }
     }
 
commit 17992bf328ffe68a8573e638f7c94beb991c5fdc
Author:     Caolán McNamara <[email protected]>
AuthorDate: Sun Jun 2 12:07:11 2024 +0100
Commit:     Caolán McNamara <[email protected]>
CommitDate: Sun Jun 2 22:46:07 2024 +0200

    cid#1602442 Uninitialized pointer field
    
    Change-Id: I3586685ba132fd09b00d778fc3fe8e479d1a8aab
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168342
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <[email protected]>

diff --git a/vcl/source/filter/jpeg/jpegc.cxx b/vcl/source/filter/jpeg/jpegc.cxx
index bc8a656c890f..5b50bd3d394e 100644
--- a/vcl/source/filter/jpeg/jpegc.cxx
+++ b/vcl/source/filter/jpeg/jpegc.cxx
@@ -54,7 +54,8 @@ struct ErrorManagerStruct
 
     ErrorManagerStruct()
     {
-        pub.msg_parm = {};
+        pub = {};
+        memset(&setjmp_buffer, 0, sizeof(setjmp_buffer));
     }
 };
 

Reply via email to