sdext/source/pdfimport/filterdet.cxx | 2 +- sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-)
New commits: commit d2d70d8a31194110380d6f8339480ec68f1197b0 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Apr 28 08:51:49 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Apr 28 11:35:37 2025 +0200 cid#1646742 Dereference after null check Change-Id: Id159ca8de614671db51fafb0e487d4d4f4548fbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184703 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/sdext/source/pdfimport/filterdet.cxx b/sdext/source/pdfimport/filterdet.cxx index 8689b190b755..9d97b69b613d 100644 --- a/sdext/source/pdfimport/filterdet.cxx +++ b/sdext/source/pdfimport/filterdet.cxx @@ -374,7 +374,7 @@ uno::Reference<io::XStream> getEmbeddedFile(const OUString& rInPDFFileURL, } bAgain = false; // The new style hybrids have exactly one embedded file - if (pPdfiumDoc->getAttachmentCount() != 1) + if (!pPdfiumDoc || pPdfiumDoc->getAttachmentCount() != 1) { SAL_INFO("sdext.pdfimport", "getEmbeddedFile incorrect attachment count"); break; commit 358c62e05f902eb601e00465b67154e30a42738a Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Mon Apr 28 08:44:54 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Apr 28 11:35:30 2025 +0200 cid#1646741 COPY_INSTEAD_OF_MOVE Change-Id: I5405517c5661bdd4c94b6d09dde9775ba9ac0f2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/184702 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx b/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx index acb3f722a238..32a20cb09c80 100644 --- a/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx +++ b/sw/source/writerfilter/rtftok/rtfdocumentimpl.cxx @@ -549,11 +549,9 @@ RTFDocumentImpl::getProperties(const RTFSprms& rAttributes, RTFSprms const& rSpr auto it = m_pStyleTableEntries->find(nStyle); if (!nStyle && it == m_pStyleTableEntries->end()) { - RTFSprms aAttributes; writerfilter::Reference<Properties>::Pointer_t pProps( - new RTFReferenceProperties(aAttributes)); - writerfilter::Reference<Properties>::Pointer_t const pProp(pProps); - m_pStyleTableEntries->insert(std::make_pair(0, pProp)); + new RTFReferenceProperties(RTFSprms())); + m_pStyleTableEntries->insert(std::make_pair(0, pProps)); it = m_pStyleTableEntries->find(nStyle); } @@ -776,11 +774,10 @@ void RTFDocumentImpl::sectBreak(bool bFinal) // Section properties are a paragraph sprm. auto pValue = new RTFValue(m_aStates.top().getSectionAttributes(), m_aStates.top().getSectionSprms()); - RTFSprms aAttributes; RTFSprms aSprms; aSprms.set(NS_ooxml::LN_CT_PPr_sectPr, pValue); writerfilter::Reference<Properties>::Pointer_t pProperties - = new RTFReferenceProperties(std::move(aAttributes), std::move(aSprms)); + = new RTFReferenceProperties(RTFSprms(), std::move(aSprms)); if (bFinal && !m_pSuperstream) // This is the end of the document, not just the end of e.g. a header. @@ -1117,7 +1114,6 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XS // Send it to the dmapper. RTFSprms aSprms; - RTFSprms aAttributes; // shape attribute RTFSprms aPicAttributes; if (m_aStates.top().getPicture().nCropT != 0 || m_aStates.top().getPicture().nCropB != 0 @@ -1274,14 +1270,14 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XS if (!m_aStates.top().getCurrentBuffer()) { writerfilter::Reference<Properties>::Pointer_t pProperties - = new RTFReferenceProperties(std::move(aAttributes), std::move(aSprms)); + = new RTFReferenceProperties(RTFSprms(), std::move(aSprms)); Mapper().props(pProperties); // Make sure we don't lose these properties with a too early reset. m_bHadPicture = true; } else { - auto pValue = new RTFValue(aAttributes, aSprms); + auto pValue = new RTFValue(RTFSprms(), aSprms); bufferProperties(*m_aStates.top().getCurrentBuffer(), pValue, nullptr); } }