New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Fri Mar 8 07:52:53 UTC 2024


Hi,

Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.

5 new defect(s) introduced to LibreOffice found with Coverity Scan.
4 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 5 of 5 defect(s)


** CID 1592991:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/chart2/source/controller/main/ChartController_Properties.cxx: 796 in chart::ChartController::executeDlg_ObjectProperties_withUndoGuard(std::shared_ptr<chart::UndoGuard>, const rtl::OUString &, bool)()


________________________________________________________________________________________________________
*** CID 1592991:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/chart2/source/controller/main/ChartController_Properties.cxx: 796 in chart::ChartController::executeDlg_ObjectProperties_withUndoGuard(std::shared_ptr<chart::UndoGuard>, const rtl::OUString &, bool)()
790             {
791                 aDlgPtr->SetAxisMinorStepWidthForErrorBarDecimals(
792                     InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( xChartDoc, m_xChartView, rObjectCID ) );
793             }
794     
795             //open the dialog
>>>     CID 1592991:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "aUndoGuard" is copied in call to copy constructor "std::shared_ptr<chart::UndoGuard>", when it could be moved instead.
796             SfxTabDialogController::runAsync(aDlgPtr, [aDlgPtr, xChartDoc, pItemConverter, bSuccessOnUnchanged, aUndoGuard] (int nResult)
797             {
798                 if (nResult == RET_OK || (bSuccessOnUnchanged && aDlgPtr->DialogWasClosedWithOK())) {
799                     const SfxItemSet* pOutItemSet = aDlgPtr->GetOutputItemSet();
800                     if(pOutItemSet) {
801                         ControllerLockGuardUNO aCLGuard(xChartDoc);

** CID 1592990:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/chart2/source/controller/main/ChartController_Properties.cxx: 712 in chart::ChartController::executeDlg_ObjectProperties(const rtl::OUString &)()


________________________________________________________________________________________________________
*** CID 1592990:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/chart2/source/controller/main/ChartController_Properties.cxx: 712 in chart::ChartController::executeDlg_ObjectProperties(const rtl::OUString &)()
706         auto aUndoGuard = std::make_shared<UndoGuard>(
707             ActionDescriptionProvider::createDescription(
708                 ActionDescriptionProvider::ActionType::Format,
709                 ObjectNameProvider::getName( ObjectIdentifier::getObjectType( aObjectCID ))),
710             m_xUndoManager );
711     
>>>     CID 1592990:  Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "aUndoGuard" is passed-by-value as parameter to "executeDlg_ObjectProperties_withUndoGuard" when it could be moved instead.
712         ChartController::executeDlg_ObjectProperties_withUndoGuard( aUndoGuard, aObjectCID, false );
713     }
714     
715     void ChartController::executeDlg_ObjectProperties_withUndoGuard(
716         std::shared_ptr<UndoGuard> aUndoGuard,const OUString& rObjectCID, bool bSuccessOnUnchanged )
717     {

** CID 1592989:  Null pointer dereferences  (FORWARD_NULL)
/vcl/source/window/brdwin.cxx: 2014 in ImplBorderWindow::FlashWindow() const()


________________________________________________________________________________________________________
*** CID 1592989:  Null pointer dereferences  (FORWARD_NULL)
/vcl/source/window/brdwin.cxx: 2014 in ImplBorderWindow::FlashWindow() const()
2008         vcl::Window* pMyParent = mpWindowImpl->mpParent;
2009         while (pMyParent && pMyParent->mpWindowImpl && pMyParent->mpWindowImpl->mpParent)
2010         {
2011             pMyParent = pMyParent->mpWindowImpl->mpParent;
2012         }
2013         if (pMyParent) {
>>>     CID 1592989:  Null pointer dereferences  (FORWARD_NULL)
>>>     Attempting to access the managed object of an empty smart pointer "pMyParent->mpWindowImpl".
2014             pMyParent->mpWindowImpl->mpFrame->FlashWindow();
2015         }
2016     }
2017     

** CID 1592988:  Uninitialized members  (UNINIT_CTOR)
/sw/source/core/text/porlay.cxx: 852 in SwLineLayout::SwLineLayout()()


________________________________________________________________________________________________________
*** CID 1592988:  Uninitialized members  (UNINIT_CTOR)
/sw/source/core/text/porlay.cxx: 852 in SwLineLayout::SwLineLayout()()
846           m_nRealHeight( 0 ),
847           m_nTextHeight( 0 ),
848           m_bUnderscore( false )
849     {
850         ResetFlags();
851         SetWhichPor( PortionType::Lay );
>>>     CID 1592988:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "m_bLastHyph" is not initialized in this constructor nor in any functions that it calls.
852     }
853     
854     SwLinePortion *SwLineLayout::GetFirstPortion() const
855     {
856         const SwLinePortion *pRet = mpNextPortion ? mpNextPortion : this;
857         return const_cast<SwLinePortion*>(pRet);

** CID 1592987:  Uninitialized variables  (UNINIT)


________________________________________________________________________________________________________
*** CID 1592987:  Uninitialized variables  (UNINIT)
/chart2/source/controller/main/ChartController_Properties.cxx: 787 in chart::ChartController::executeDlg_ObjectProperties_withUndoGuard(std::shared_ptr<chart::UndoGuard>, const rtl::OUString &, bool)()
781                 SfxItemSet aSymbolShapeProperties(aSymbolItemConverter.CreateEmptyItemSet() );
782                 aSymbolItemConverter.FillItemSet( aSymbolShapeProperties );
783     
784                 sal_Int32 const nStandardSymbol=0;//@todo get from somewhere
785                 std::optional<Graphic> oAutoSymbolGraphic(std::in_place, aViewElementListProvider.GetSymbolGraphic( nStandardSymbol, &aSymbolShapeProperties ) );
786                 // note: the dialog takes the ownership of pSymbolShapeProperties and pAutoSymbolGraphic
>>>     CID 1592987:  Uninitialized variables  (UNINIT)
>>>     Using uninitialized value "<temporary>._M_payload._M_payload" when calling "~optional".
787                 aDlgPtr->setSymbolInformation( std::move(aSymbolShapeProperties), std::move(oAutoSymbolGraphic) );
788             }
789             if( aDialogParameter.HasStatisticProperties() )
790             {
791                 aDlgPtr->SetAxisMinorStepWidthForErrorBarDecimals(
792                     InsertErrorBarsDialog::getAxisMinorStepWidthForErrorBarDecimals( xChartDoc, m_xChartView, rObjectCID ) );


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2BKADyCpvUKOL6EWmZljiu6VvXBlQRUbS683tC8265rGNPXqJ1ffcoLZCnTuJFQbNcTEkb4XaEQkzovKhJ5DB3c-3D-8yU_A9M4dSy7guk8NP6DcfgslOyvJRzavztVIKj6nRqYjYpWom7SJFyX0y710bz0kUGtR3MTD97eGUr-2FnsMrZcBCuYj8mgvt0yGPp3GC4E6WlBWhjY6GnSxHxctU5Q1IAw9QiBZgKljDMCgMXUoNOY0n-2BH0CabSUxI6pwmyu-2BHUkD8u9jyc18gjLuyC0HyRNzbTb2fg9ryEFRExXKViu2ALKPxongAzIcQHphBRHTUpUmvw-3D



More information about the LibreOffice mailing list