New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Wed Dec 20 13:14:17 UTC 2017


Hi,

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

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


** CID 1426744:  Uninitialized variables  (UNINIT)
/oox/source/export/drawingml.cxx: 2417 in oox::drawingml::DrawingML::WriteText(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface> &, const rtl::OUString &, bool, bool, int)()


________________________________________________________________________________________________________
*** CID 1426744:  Uninitialized variables  (UNINIT)
/oox/source/export/drawingml.cxx: 2417 in oox::drawingml::DrawingML::WriteText(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface> &, const rtl::OUString &, bool, bool, int)()
2411                     delete pParaObj;
2412             }
2413             return;
2414         }
2415     
2416         bool bOverridingCharHeight = false;
>>>     CID 1426744:  Uninitialized variables  (UNINIT)
>>>     Declaring variable "nCharHeight" without initializer.
2417         sal_Int32 nCharHeight;
2418     
2419         while( enumeration->hasMoreElements() )
2420         {
2421             Reference< XTextContent > paragraph;
2422             Any any ( enumeration->nextElement() );

** CID 1426743:  Uninitialized members  (UNINIT_CTOR)
/sc/source/filter/orcus/interface.cxx: 184 in ScOrcusFactory::CellStoreToken::CellStoreToken(const ScAddress &, ScOrcusFactory::CellStoreToken::Type)()


________________________________________________________________________________________________________
*** CID 1426743:  Uninitialized members  (UNINIT_CTOR)
/sc/source/filter/orcus/interface.cxx: 184 in ScOrcusFactory::CellStoreToken::CellStoreToken(const ScAddress &, ScOrcusFactory::CellStoreToken::Type)()
178     }
179     
180     ScOrcusFactory::CellStoreToken::CellStoreToken( const ScAddress& rPos, Type eType ) :
181         maPos(rPos), meType(eType)
182     {
183         rtl::math::setNan(&mfValue);
>>>     CID 1426743:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "meGrammar" is not initialized in this constructor nor in any functions that it calls.
184     }
185     
186     ScOrcusFactory::CellStoreToken::CellStoreToken( const ScAddress& rPos, double fValue ) :
187         maPos(rPos), meType(Type::Numeric), mfValue(fValue) {}
188     
189     ScOrcusFactory::CellStoreToken::CellStoreToken( const ScAddress& rPos, uint32_t nIndex ) :

** CID 1426742:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/frmedt/feshview.cxx: 1571 in SwFEShell::GetBestObject(bool, GotoObjFlags, bool, const svx::ISdrObjectFilter *)()


________________________________________________________________________________________________________
*** CID 1426742:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/frmedt/feshview.cxx: 1571 in SwFEShell::GetBestObject(bool, GotoObjFlags, bool, const svx::ISdrObjectFilter *)()
1565                             default: break;
1566                         }
1567                     }
1568                     aCurPos = pFly->getFrameArea().Pos();
1569                 }
1570                 else
>>>     CID 1426742:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "pObj" to "GetCurrentBoundRect", which dereferences it. (The dereference happens because this is a virtual function call.)
1571                     aCurPos = pObj->GetCurrentBoundRect().TopLeft();
1572     
1573                 // Special case if another object is on same Y.
1574                 if( aCurPos != aPos &&          // only when it is not me
1575                     aCurPos.getY() == aPos.getY() &&  // Y positions equal
1576                     (bNext? (aCurPos.getX() > aPos.getX()) :  // lies next to me

** CID 1426741:  Uninitialized members  (UNINIT_CTOR)
/sc/source/filter/orcus/interface.cxx: 193 in ScOrcusFactory::CellStoreToken::CellStoreToken(const ScAddress &, unsigned int)()


________________________________________________________________________________________________________
*** CID 1426741:  Uninitialized members  (UNINIT_CTOR)
/sc/source/filter/orcus/interface.cxx: 193 in ScOrcusFactory::CellStoreToken::CellStoreToken(const ScAddress &, unsigned int)()
187         maPos(rPos), meType(Type::Numeric), mfValue(fValue) {}
188     
189     ScOrcusFactory::CellStoreToken::CellStoreToken( const ScAddress& rPos, uint32_t nIndex ) :
190         maPos(rPos), meType(Type::String), mnIndex1(nIndex)
191     {
192         rtl::math::setNan(&mfValue);
>>>     CID 1426741:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "meGrammar" is not initialized in this constructor nor in any functions that it calls.
193     }
194     
195     ScOrcusFactory::CellStoreToken::CellStoreToken(
196         const ScAddress& rPos, const OUString& rFormula, formula::FormulaGrammar::Grammar eGrammar ) :
197         maPos(rPos), meType(Type::Formula), maStr1(rFormula), meGrammar(eGrammar)
198     {

** CID 1426740:  Uninitialized members  (UNINIT_CTOR)
/sc/source/filter/orcus/interface.cxx: 200 in ScOrcusFactory::CellStoreToken::CellStoreToken(const ScAddress &, const rtl::OUString &, formula::FormulaGrammar::Grammar)()


________________________________________________________________________________________________________
*** CID 1426740:  Uninitialized members  (UNINIT_CTOR)
/sc/source/filter/orcus/interface.cxx: 200 in ScOrcusFactory::CellStoreToken::CellStoreToken(const ScAddress &, const rtl::OUString &, formula::FormulaGrammar::Grammar)()
194     
195     ScOrcusFactory::CellStoreToken::CellStoreToken(
196         const ScAddress& rPos, const OUString& rFormula, formula::FormulaGrammar::Grammar eGrammar ) :
197         maPos(rPos), meType(Type::Formula), maStr1(rFormula), meGrammar(eGrammar)
198     {
199         rtl::math::setNan(&mfValue);
>>>     CID 1426740:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "mnIndex2" is not initialized in this constructor nor in any functions that it calls.
200     }
201     
202     ScOrcusFactory::ScOrcusFactory(ScDocument& rDoc) :
203         maDoc(rDoc),
204         maGlobalSettings(maDoc),
205         maRefResolver(maGlobalSettings),

** CID 1426739:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)
/vcl/source/window/builder.cxx: 1647 in VclBuilder::makeObject(vcl::Window *, const rtl::OString &, const rtl::OString &, std::map<rtl::OString, rtl::OUString, std::less<rtl::OString>, std::allocator<std::pair<const rtl::OString, rtl::OUString>>> &)()


________________________________________________________________________________________________________
*** CID 1426739:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)
/vcl/source/window/builder.cxx: 1647 in VclBuilder::makeObject(vcl::Window *, const rtl::OString &, const rtl::OString &, std::map<rtl::OString, rtl::OUString, std::less<rtl::OString>, std::allocator<std::pair<const rtl::OString, rtl::OUString>>> &)()
1641                     {
1642                         ok = pModule->loadRelative(&thisModule, sModule);
1643                     }
1644     #else
1645                     bool ok = pModule->loadRelative(&thisModule, sModule);
1646     #endif
>>>     CID 1426739:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)
>>>     "ok || true /* "bad module name in .ui" */" is always true regardless of the values of its operands. This occurs as the logical first operand of "?:".
1647                     assert(ok || "bad module name in .ui"); (void)ok;
1648                     aI = m_aModuleMap.insert(std::make_pair(sModule, std::unique_ptr<osl::Module>(pModule))).first;
1649                 }
1650                 customMakeWidget pFunction = reinterpret_cast<customMakeWidget>(aI->second->getFunctionSymbol(sFunction));
1651     #else
1652                 customMakeWidget pFunction = reinterpret_cast<customMakeWidget>(osl_getFunctionSymbol((oslModule) RTLD_DEFAULT, sFunction.pData));

** CID 1426738:  Null pointer dereferences  (NULL_RETURNS)
/vcl/source/window/menubarwindow.cxx: 317 in MenuBarWindow::ImplCreatePopup(bool)()


________________________________________________________________________________________________________
*** CID 1426738:  Null pointer dereferences  (NULL_RETURNS)
/vcl/source/window/menubarwindow.cxx: 317 in MenuBarWindow::ImplCreatePopup(bool)()
311                     for (sal_uInt16 i = nHighlightedItem; i < pMenu->GetItemCount(); ++i)
312                     {
313                         sal_uInt16 nId = pMenu->GetItemId(i);
314     
315                         MenuItemData* pParentItemData = pMenu->GetItemList()->GetData(nId);
316     
>>>     CID 1426738:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a null pointer "pParentItemData".
317                         mpParentPopup->InsertItem(nId, pParentItemData->aText, pParentItemData->nBits, pParentItemData->sIdent);
318                         mpParentPopup->SetHelpId(nId, pParentItemData->aHelpId);
319                         mpParentPopup->SetHelpText(nId, pParentItemData->aHelpText);
320                         mpParentPopup->SetAccelKey(nId, pParentItemData->aAccelKey);
321                         mpParentPopup->SetItemCommand(nId, pParentItemData->aCommandStr);
322                         mpParentPopup->SetHelpCommand(nId, pParentItemData->aHelpCommandStr);

** CID 1426737:  Uninitialized members  (UNINIT_CTOR)
/sc/source/filter/orcus/interface.cxx: 187 in ScOrcusFactory::CellStoreToken::CellStoreToken(const ScAddress &, double)()


________________________________________________________________________________________________________
*** CID 1426737:  Uninitialized members  (UNINIT_CTOR)
/sc/source/filter/orcus/interface.cxx: 187 in ScOrcusFactory::CellStoreToken::CellStoreToken(const ScAddress &, double)()
181         maPos(rPos), meType(eType)
182     {
183         rtl::math::setNan(&mfValue);
184     }
185     
186     ScOrcusFactory::CellStoreToken::CellStoreToken( const ScAddress& rPos, double fValue ) :
>>>     CID 1426737:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "meGrammar" is not initialized in this constructor nor in any functions that it calls.
187         maPos(rPos), meType(Type::Numeric), mfValue(fValue) {}
188     
189     ScOrcusFactory::CellStoreToken::CellStoreToken( const ScAddress& rPos, uint32_t nIndex ) :
190         maPos(rPos), meType(Type::String), mnIndex1(nIndex)
191     {
192         rtl::math::setNan(&mfValue);

** CID 1426736:  Uninitialized members  (UNINIT_CTOR)
/sc/source/filter/orcus/interface.cxx: 91 in ScOrcusGlobalSettings::ScOrcusGlobalSettings(ScDocumentImport &)()


________________________________________________________________________________________________________
*** CID 1426736:  Uninitialized members  (UNINIT_CTOR)
/sc/source/filter/orcus/interface.cxx: 91 in ScOrcusGlobalSettings::ScOrcusGlobalSettings(ScDocumentImport &)()
85         return eGrammar;
86     }
87     
88     }
89     
90     ScOrcusGlobalSettings::ScOrcusGlobalSettings(ScDocumentImport& rDoc) :
>>>     CID 1426736:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "meCalcGrammar" is not initialized in this constructor nor in any functions that it calls.
91         mrDoc(rDoc), meOrcusGrammar(os::formula_grammar_t::unknown) {}
92     
93     void ScOrcusGlobalSettings::set_origin_date(int year, int month, int day)
94     {
95         mrDoc.setOriginDate(year, month, day);
96     }

** CID 1426735:  Null pointer dereferences  (NULL_RETURNS)
/vcl/source/window/menubarwindow.cxx: 372 in MenuBarWindow::KillActivePopup()()


________________________________________________________________________________________________________
*** CID 1426735:  Null pointer dereferences  (NULL_RETURNS)
/vcl/source/window/menubarwindow.cxx: 372 in MenuBarWindow::KillActivePopup()()
366             {
367                 if (mpParentPopup)
368                 {
369                     for (sal_uInt16 i = 0; i < mpParentPopup->GetItemCount(); ++i)
370                     {
371                         sal_uInt16 nId = mpParentPopup->GetItemId(i);
>>>     CID 1426735:  Null pointer dereferences  (NULL_RETURNS)
>>>     Assigning: "pParentItemData" = null return value from "GetData".
372                         MenuItemData* pParentItemData = mpParentPopup->GetItemList()->GetData(nId);
373                         pParentItemData->pSubMenu = nullptr;
374                     }
375                 }
376                 pActivePopup->ImplGetFloatingWindow()->StopExecute();
377                 pActivePopup->ImplGetFloatingWindow()->doShutdown();


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZBnDJeNb0HijxaS4JNJPxk3kpyAm2AYqo71yXmnOxB72ibeUH-2F-2F1Lhi9AZq3dRu-2F4-3D_g-2BrHdvqzaBa155F-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpyLwumZygdCVj4NxogutMGM4osH73SNqtY354Q7Et2-2FDyJoZUsNHnIAVeu9wooIcx91pe3iY44-2BlWtd19FcZiFHB6P9oHEU237DGNbFBS53WAsrvJvEpeVL22ugoVcNc1kR4nEJw2hXe6YWsrJfdE-2F-2Bs6AoJVvBx-2FzNnkITKxm8j0-3D

To manage Coverity Scan email notifications for "libreoffice at lists.freedesktop.org", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4k1FZJSDV-2FTHi5VQof9xGafB4oBwGYxuHHknceo2QLpCrZ44Ciy7AqBR2QyX6OCB5lwWgMDuK-2FivqaohkU3M9kT-2Fww10Qt2GoaCJAOQCa0Wv4ijH4oV8jCt0XXa7QeAwh_g-2BrHdvqzaBa155F-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpyLwumZygdCVj4NxogutMGMwWnM6xVqv4s1XQumacEv8V1AAnpr7tkZBkQ7bErtl40OgZXTmQIpYVsyyHww1FFWZWmeX50k2QGOgKvQVCl58dfeUXOqRXk6UFTDtUEGGTnMWX5OOfLxHc6d4dArvpSAZ6aCqqd6xdT6wZlA58YUcU-3D



More information about the LibreOffice mailing list