Hi, Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.
9 new defect(s) introduced to LibreOffice found with Coverity Scan. 1 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 9 of 9 defect(s) ** CID 1357172: Code maintainability issues (UNUSED_VALUE) /sw/source/filter/html/svxcss1.cxx: 630 in SvxCSS1PropertyInfo::SetBoxItem(SfxItemSet &, unsigned short, const SvxBoxItem *)() ________________________________________________________________________________________________________ *** CID 1357172: Code maintainability issues (UNUSED_VALUE) /sw/source/filter/html/svxcss1.cxx: 630 in SvxCSS1PropertyInfo::SetBoxItem(SfxItemSet &, unsigned short, const SvxBoxItem *)() 624 if( nDist < nMinBorderDist ) 625 nDist = nMinBorderDist; 626 } 627 else 628 { 629 if( USHRT_MAX == nDist ) >>> CID 1357172: Code maintainability issues (UNUSED_VALUE) >>> Assigning value from "aBoxItem.GetDistance(nLine)" to "nDist" here, but >>> that stored value is overwritten before it can be used. 630 nDist = aBoxItem.GetDistance( nLine ); 631 632 nDist = 0U; 633 } 634 635 aBoxItem.SetDistance( nDist, nLine ); ** CID 1357171: Uninitialized members (UNINIT_CTOR) /sw/source/ui/dbui/mmgreetingspage.hxx: 66 in SwGreetingsHandler::SwGreetingsHandler(SwMailMergeConfigItem &)() ________________________________________________________________________________________________________ *** CID 1357171: Uninitialized members (UNINIT_CTOR) /sw/source/ui/dbui/mmgreetingspage.hxx: 66 in SwGreetingsHandler::SwGreetingsHandler(SwMailMergeConfigItem &)() 60 /// The mail merge state, available even when m_pWizard is nullptr. 61 SwMailMergeConfigItem& m_rConfigItem; 62 63 SwGreetingsHandler(SwMailMergeConfigItem& rConfigItem) 64 : m_rConfigItem(rConfigItem) 65 { >>> CID 1357171: Uninitialized members (UNINIT_CTOR) >>> Non-static class member "m_bIsTabPage" is not initialized in this >>> constructor nor in any functions that it calls. 66 } 67 68 ~SwGreetingsHandler() {} 69 70 DECL_LINK_TYPED(IndividualHdl_Impl, Button*, void); 71 DECL_LINK_TYPED(GreetingHdl_Impl, Button*, void); ** CID 1357170: Uninitialized members (UNINIT_CTOR) /sw/source/ui/dbui/mmresultdialogs.cxx: 240 in SwMMResultSaveDialog::SwMMResultSaveDialog(vcl::Window *)() ________________________________________________________________________________________________________ *** CID 1357170: Uninitialized members (UNINIT_CTOR) /sw/source/ui/dbui/mmresultdialogs.cxx: 240 in SwMMResultSaveDialog::SwMMResultSaveDialog(vcl::Window *)() 234 m_pSaveIndividualRB->SetClickHdl(aLink); 235 m_pFromRB->SetClickHdl(aLink); 236 // m_pSaveAsOneRB is the default, so disable m_pFromNF and m_pToNF initially. 237 aLink.Call(m_pSaveAsOneRB); 238 239 m_pOKButton->SetClickHdl(LINK(this, SwMMResultSaveDialog, SaveOutputHdl_Impl)); >>> CID 1357170: Uninitialized members (UNINIT_CTOR) >>> Non-static class member "m_bCancelSaving" is not initialized in this >>> constructor nor in any functions that it calls. 240 } 241 242 SwMMResultSaveDialog::~SwMMResultSaveDialog() 243 { 244 disposeOnce(); 245 } ** CID 1357167: Control flow issues (MISSING_BREAK) /sw/source/uibase/app/apphdl.cxx: 796 in SwModule::ExecOther(SfxRequest &)() ________________________________________________________________________________________________________ *** CID 1357167: Control flow issues (MISSING_BREAK) /sw/source/uibase/app/apphdl.cxx: 796 in SwModule::ExecOther(SfxRequest &)() 790 { 791 SwMailMergeConfigItem* pConfigItem = PerformMailMerge(GetActiveView()); 792 793 if (pConfigItem && pConfigItem->GetTargetView()) 794 pConfigItem->GetTargetView()->GetViewFrame()->GetFrame().Appear(); 795 } >>> CID 1357167: Control flow issues (MISSING_BREAK) >>> The above case falls through to this one. 796 case FN_MAILMERGE_SAVE_DOCUMENTS: 797 case FN_MAILMERGE_PRINT_DOCUMENTS: 798 case FN_MAILMERGE_EMAIL_DOCUMENTS: 799 { 800 SwMailMergeConfigItem* pConfigItem = PerformMailMerge(GetActiveView()); 801 if (!pConfigItem) ** CID 1357166: Null pointer dereferences (FORWARD_NULL) /sw/source/uibase/dbui/dbmgr.cxx: 1001 in SwDBManager::MergeMailFiles(SwWrtShell *, const SwMergeDescriptor &, vcl::Window *)() ________________________________________________________________________________________________________ *** CID 1357166: Null pointer dereferences (FORWARD_NULL) /sw/source/uibase/dbui/dbmgr.cxx: 1001 in SwDBManager::MergeMailFiles(SwWrtShell *, const SwMergeDescriptor &, vcl::Window *)() 995 const bool bIsPDFexport = pStoreToFilter && pStoreToFilter->GetFilterName() == "writer_pdf_Export"; 996 997 bCancel = false; 998 999 // in case of creating a single resulting file this has to be created here 1000 SwView* pTargetView = rMergeDescriptor.pMailMergeConfigItem ? rMergeDescriptor.pMailMergeConfigItem->GetTargetView() : nullptr; >>> CID 1357166: Null pointer dereferences (FORWARD_NULL) >>> Assigning: "pTargetShell" = "NULL". 1001 SwWrtShell* pTargetShell = nullptr; 1002 SwDoc* pTargetDoc = nullptr; 1003 SfxObjectShellRef xTargetDocShell = nullptr; 1004 1005 std::unique_ptr< utl::TempFile > aTempFile; 1006 bool createTempFile = ( bEMail || rMergeDescriptor.nMergeType == DBMGR_MERGE_FILE ); ** CID 1357165: (DIVIDE_BY_ZERO) /sd/source/ui/view/drviewsh.cxx: 178 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() /sd/source/ui/view/drviewsh.cxx: 186 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() /sd/source/ui/view/drviewsh.cxx: 178 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() /sd/source/ui/view/drviewsh.cxx: 186 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() ________________________________________________________________________________________________________ *** CID 1357165: (DIVIDE_BY_ZERO) /sd/source/ui/view/drviewsh.cxx: 178 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() 172 else 173 { 174 const long distBottom(rRect.Bottom() - aNewPos.Y() + aVisAreaSize.Height()); 175 176 if(distBottom > 0) 177 { >>> CID 1357165: (DIVIDE_BY_ZERO) >>> In expression "distBottom / nFreeSpaceY", division by expression >>> "nFreeSpaceY" which may be zero has undefined behavior. 178 long mult = (distBottom / nFreeSpaceY) + 1; 179 aNewPos.Y() += mult * nFreeSpaceY; 180 } 181 182 const long distTop(aNewPos.Y() - rRect.Top()); 183 /sd/source/ui/view/drviewsh.cxx: 186 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() 180 } 181 182 const long distTop(aNewPos.Y() - rRect.Top()); 183 184 if(distTop > 0) 185 { >>> CID 1357165: (DIVIDE_BY_ZERO) >>> In expression "distTop / nFreeSpaceY", division by expression >>> "nFreeSpaceY" which may be zero has undefined behavior. 186 long mult = (distTop / nFreeSpaceY) + 1; 187 aNewPos.Y() -= mult * nFreeSpaceY; 188 } 189 } 190 } 191 /sd/source/ui/view/drviewsh.cxx: 178 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() 172 else 173 { 174 const long distBottom(rRect.Bottom() - aNewPos.Y() + aVisAreaSize.Height()); 175 176 if(distBottom > 0) 177 { >>> CID 1357165: (DIVIDE_BY_ZERO) >>> In expression "distBottom / nFreeSpaceY", division by expression >>> "nFreeSpaceY" which may be zero has undefined behavior. 178 long mult = (distBottom / nFreeSpaceY) + 1; 179 aNewPos.Y() += mult * nFreeSpaceY; 180 } 181 182 const long distTop(aNewPos.Y() - rRect.Top()); 183 /sd/source/ui/view/drviewsh.cxx: 186 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() 180 } 181 182 const long distTop(aNewPos.Y() - rRect.Top()); 183 184 if(distTop > 0) 185 { >>> CID 1357165: (DIVIDE_BY_ZERO) >>> In expression "distTop / nFreeSpaceY", division by expression >>> "nFreeSpaceY" which may be zero has undefined behavior. 186 long mult = (distTop / nFreeSpaceY) + 1; 187 aNewPos.Y() -= mult * nFreeSpaceY; 188 } 189 } 190 } 191 ** CID 1357164: (DIVIDE_BY_ZERO) /sd/source/ui/view/drviewsh.cxx: 141 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() /sd/source/ui/view/drviewsh.cxx: 133 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() /sd/source/ui/view/drviewsh.cxx: 141 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() /sd/source/ui/view/drviewsh.cxx: 133 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() ________________________________________________________________________________________________________ *** CID 1357164: (DIVIDE_BY_ZERO) /sd/source/ui/view/drviewsh.cxx: 141 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() 135 } 136 137 const long distLeft(aNewPos.X() - rRect.Left()); 138 139 if(distLeft > 0) 140 { >>> CID 1357164: (DIVIDE_BY_ZERO) >>> In expression "distLeft / nFreeSpaceX", division by expression >>> "nFreeSpaceX" which may be zero has undefined behavior. 141 long mult = (distLeft / nFreeSpaceX) + 1; 142 aNewPos.X() -= mult * nFreeSpaceX; 143 } 144 } 145 } 146 /sd/source/ui/view/drviewsh.cxx: 133 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() 127 else 128 { 129 const long distRight(rRect.Right() - aNewPos.X() + aVisAreaSize.Width()); 130 131 if(distRight > 0) 132 { >>> CID 1357164: (DIVIDE_BY_ZERO) >>> In expression "distRight / nFreeSpaceX", division by expression >>> "nFreeSpaceX" which may be zero has undefined behavior. 133 long mult = (distRight / nFreeSpaceX) + 1; 134 aNewPos.X() += mult * nFreeSpaceX; 135 } 136 137 const long distLeft(aNewPos.X() - rRect.Left()); 138 /sd/source/ui/view/drviewsh.cxx: 141 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() 135 } 136 137 const long distLeft(aNewPos.X() - rRect.Left()); 138 139 if(distLeft > 0) 140 { >>> CID 1357164: (DIVIDE_BY_ZERO) >>> In expression "distLeft / nFreeSpaceX", division by expression >>> "nFreeSpaceX" which may be zero has undefined behavior. 141 long mult = (distLeft / nFreeSpaceX) + 1; 142 aNewPos.X() -= mult * nFreeSpaceX; 143 } 144 } 145 } 146 /sd/source/ui/view/drviewsh.cxx: 133 in sd::DrawViewShell::MakeVisible(const Rectangle &, vcl::Window &)() 127 else 128 { 129 const long distRight(rRect.Right() - aNewPos.X() + aVisAreaSize.Width()); 130 131 if(distRight > 0) 132 { >>> CID 1357164: (DIVIDE_BY_ZERO) >>> In expression "distRight / nFreeSpaceX", division by expression >>> "nFreeSpaceX" which may be zero has undefined behavior. 133 long mult = (distRight / nFreeSpaceX) + 1; 134 aNewPos.X() += mult * nFreeSpaceX; 135 } 136 137 const long distLeft(aNewPos.X() - rRect.Left()); 138 ** CID 1357163: Possible Control flow issues (DEADCODE) /framework/source/fwi/classes/propertysethelper.cxx: 168 in framework::PropertySetHelper::setPropertyValue(const rtl::OUString &, const com::sun::star::uno::Any &)() ________________________________________________________________________________________________________ *** CID 1357163: Possible Control flow issues (DEADCODE) /framework/source/fwi/classes/propertysethelper.cxx: 168 in framework::PropertySetHelper::setPropertyValue(const rtl::OUString &, const com::sun::star::uno::Any &)() 162 bool bLocked = true; 163 css::uno::Any aCurrentValue = impl_getPropertyValue(aPropInfo.Name, aPropInfo.Handle); 164 165 if (! bLocked) 166 { 167 // SAFE -> >>> CID 1357163: Possible Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "aWriteLock.reset();". 168 aWriteLock.reset(); 169 } 170 171 bool bWillBeChanged = (aCurrentValue != aValue); 172 if (! bWillBeChanged) 173 return; ** CID 1357162: Control flow issues (DEADCODE) /svl/source/items/poolio.cxx: 1271 in SfxItemPool::LoadItem(SvStream &, const SfxItemPool*)() ________________________________________________________________________________________________________ *** CID 1357162: Control flow issues (DEADCODE) /svl/source/items/poolio.cxx: 1271 in SfxItemPool::LoadItem(SvStream &, const SfxItemPool*)() 1265 DBG_ASSERT( nIEnd <= (nIStart+nLen), "read past end of item" ); 1266 if ( (nIStart+nLen) != nIEnd ) 1267 rStream.Seek( nIStart+nLen ); 1268 } 1269 else 1270 // SKip Item >>> CID 1357162: Control flow issues (DEADCODE) >>> Execution cannot reach this statement: "rStream->Seek(nIStart + nLen);". 1271 rStream.Seek( nIStart+nLen ); 1272 } 1273 1274 return pItem; 1275 } 1276 ________________________________________________________________________________________________________ To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/libreoffice?tab=overview To manage Coverity Scan email notifications for "libreoffice@lists.freedesktop.org", click https://scan.coverity.com/subscriptions/edit?email=libreoffice%40lists.freedesktop.org&token=d6481d718a775246b2340f282ebe5939 _______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice