Hi, Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan. 2 new defect(s) introduced to LibreOffice found with Coverity Scan. 3 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan. New defect(s) Reported-by: Coverity Scan Showing 2 of 2 defect(s) ** CID 1466265: Control flow issues (DEADCODE) /sw/source/uibase/config/StoredChapterNumbering.cxx: 354 in sw::<unnamed>::StoredChapterNumberingRootContext::createFastChildContext(int, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> &)() ________________________________________________________________________________________________________ *** CID 1466265: Control flow issues (DEADCODE) /sw/source/uibase/config/StoredChapterNumbering.cxx: 354 in sw::<unnamed>::StoredChapterNumberingRootContext::createFastChildContext(int, const com::sun::star::uno::Reference<com::sun::star::xml::sax::XFastAttributeList> &)() 348 else if (Element == XML_ELEMENT(STYLE, XML_STYLE)) 349 { 350 return new StoredChapterNumberingDummyStyleContext(GetImport(), xAttrList); 351 } 352 else if (Element == XML_ELEMENT(TEXT, XML_OUTLINE_STYLE)) 353 { >>> CID 1466265: Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "++this->m_nCounter;". 354 ++m_nCounter; 355 if (m_nCounter <= SwChapterNumRules::nMaxRules) 356 { 357 SvxXMLListStyleContext *const pContext( 358 new SvxXMLListStyleContext(GetImport(), 359 Element, xAttrList, true)); ** CID 1466264: (NULL_RETURNS) /cui/source/tabpages/border.cxx: 887 in SvxBorderTabPage::FillItemSet(SfxItemSet *)() /cui/source/tabpages/border.cxx: 904 in SvxBorderTabPage::FillItemSet(SfxItemSet *)() ________________________________________________________________________________________________________ *** CID 1466264: (NULL_RETURNS) /cui/source/tabpages/border.cxx: 849 in SvxBorderTabPage::FillItemSet(SfxItemSet *)() 843 bool bAttrsChanged = false; 844 845 SfxItemPool* pPool = rCoreAttrs->GetPool(); 846 847 if (m_aFrameSel.IsBorderEnabled(svx::FrameBorderType::TLBR)) 848 { >>> CID 1466264: (NULL_RETURNS) >>> Dereferencing a pointer that might be "nullptr" "static_cast<SvxLineItem const *>(this->GetOldItem(rCoreAttrs, 11013, true))" when calling "SvxLineItem". 849 SvxLineItem aLineItem(*static_cast<const SvxLineItem*>(GetOldItem(*rCoreAttrs, SID_ATTR_BORDER_DIAG_TLBR))); 850 aLineItem.SetLine(m_aFrameSel.GetFrameBorderStyle(svx::FrameBorderType::TLBR)); 851 rCoreAttrs->Put(aLineItem); 852 bAttrsChanged = true; 853 } 854 /cui/source/tabpages/border.cxx: 887 in SvxBorderTabPage::FillItemSet(SfxItemSet *)() 881 { 882 sal_uInt16 nMergeAdjacentBordersId = pPool->GetWhich(SID_SW_COLLAPSING_BORDERS); 883 rCoreAttrs->ClearItem(nMergeAdjacentBordersId); 884 } 885 else 886 { >>> CID 1466264: (NULL_RETURNS) >>> Dereferencing a pointer that might be "nullptr" "this->GetOldItem(rCoreAttrs, 11011, true)" when calling "Clone". (The dereference happens because this is a virtual function call.) 887 std::unique_ptr<SfxBoolItem> xNewItem(static_cast<SfxBoolItem*>(GetOldItem(*rCoreAttrs, SID_SW_COLLAPSING_BORDERS)->Clone())); 888 xNewItem->SetValue(static_cast<bool>(nState)); 889 rCoreAttrs->Put(std::move(xNewItem)); 890 } 891 bAttrsChanged = true; 892 } /cui/source/tabpages/border.cxx: 904 in SvxBorderTabPage::FillItemSet(SfxItemSet *)() 898 { 899 sal_uInt16 nMergeWithNextId = pPool->GetWhich(SID_ATTR_BORDER_CONNECT); 900 rCoreAttrs->ClearItem(nMergeWithNextId); 901 } 902 else 903 { >>> CID 1466264: (NULL_RETURNS) >>> Dereferencing a pointer that might be "nullptr" "this->GetOldItem(rCoreAttrs, 10990, true)" when calling "Clone". (The dereference happens because this is a virtual function call.) 904 std::unique_ptr<SfxBoolItem> xNewItem(static_cast<SfxBoolItem*>(GetOldItem(*rCoreAttrs, SID_ATTR_BORDER_CONNECT)->Clone())); 905 xNewItem->SetValue(static_cast<bool>(nState)); 906 rCoreAttrs->Put(std::move(xNewItem)); 907 } 908 bAttrsChanged = true; 909 } /cui/source/tabpages/border.cxx: 873 in SvxBorderTabPage::FillItemSet(SfxItemSet *)() 867 bAttrsChanged = true; 868 } 869 870 if (m_xMarginControls && m_xMarginControls->get_value_changed_from_saved()) 871 { 872 const SvxMarginItem& rOldMarginItem = *static_cast<const SvxMarginItem*>(GetOldItem(*rCoreAttrs, SID_ATTR_ALIGN_MARGIN)); >>> CID 1466264: (NULL_RETURNS) >>> Dereferencing a pointer that might be "nullptr" "rOldMarginItem" when calling "GetControlValue". 873 rCoreAttrs->Put(m_xMarginControls->GetControlValue(rOldMarginItem)); 874 bAttrsChanged = true; 875 } 876 877 if (m_xMergeAdjacentBordersCB->get_state_changed_from_saved()) 878 { /cui/source/tabpages/border.cxx: 866 in SvxBorderTabPage::FillItemSet(SfxItemSet *)() 860 bAttrsChanged = true; 861 } 862 863 if (m_xShadowControls && m_xShadowControls->get_value_changed_from_saved()) 864 { 865 const SvxShadowItem& rOldShadowItem = *static_cast<const SvxShadowItem*>(GetOldItem(*rCoreAttrs, mnShadowSlot)); >>> CID 1466264: (NULL_RETURNS) >>> Dereferencing a pointer that might be "nullptr" "rOldShadowItem" when calling "GetControlValue". 866 rCoreAttrs->Put(m_xShadowControls->GetControlValue(rOldShadowItem)); 867 bAttrsChanged = true; 868 } 869 870 if (m_xMarginControls && m_xMarginControls->get_value_changed_from_saved()) 871 { /cui/source/tabpages/border.cxx: 857 in SvxBorderTabPage::FillItemSet(SfxItemSet *)() 851 rCoreAttrs->Put(aLineItem); 852 bAttrsChanged = true; 853 } 854 855 if (m_aFrameSel.IsBorderEnabled(svx::FrameBorderType::BLTR)) 856 { >>> CID 1466264: (NULL_RETURNS) >>> Dereferencing a pointer that might be "nullptr" "static_cast<SvxLineItem const *>(this->GetOldItem(rCoreAttrs, 11014, true))" when calling "SvxLineItem". 857 SvxLineItem aLineItem(*static_cast<const SvxLineItem*>(GetOldItem(*rCoreAttrs, SID_ATTR_BORDER_DIAG_BLTR))); 858 aLineItem.SetLine(m_aFrameSel.GetFrameBorderStyle(svx::FrameBorderType::BLTR)); 859 rCoreAttrs->Put(aLineItem); 860 bAttrsChanged = true; 861 } 862 ________________________________________________________________________________________________________ To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3DHzDT_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJi93-2BgECV3AtUAB222-2BbIRMOZ9uVKbKalMLuMuRswLrCzTHNiPRIgbYnylQJU19sK9zw1ACxkGZ5sxvkh4OA4Q-2BOn0-2BkGe2mx742Rlys-2F63ewVO-2BJSwapO7iZ-2BEEh9acJOIKs0xX-2FU-2BFuYcCtPRlxdBqV7wBxQRynptZXQNZGE0Ctakqk7uRDaZFernLADvPMk _______________________________________________ LibreOffice mailing list LibreOffice@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/libreoffice