New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Sat Jul 13 13:08:40 UTC 2024


Hi,

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

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


** CID 1610243:  Uninitialized members  (UNINIT_CTOR)
/sw/source/uibase/wrtsh/select.cxx: 754 in SwWrtShell::SetInsMode(bool)::[lambda(int) (instance 1)]::lambda(const [lambda(int) (instance 1)]&)()


________________________________________________________________________________________________________
*** CID 1610243:  Uninitialized members  (UNINIT_CTOR)
/sw/source/uibase/wrtsh/select.cxx: 754 in SwWrtShell::SetInsMode(bool)::[lambda(int) (instance 1)]::lambda(const [lambda(int) (instance 1)]&)()
748     void SwWrtShell::SetInsMode( bool bOn )
749     {
750         const bool bDoAsk = officecfg::Office::Common::Misc::QuerySetInsMode::get();
751         if (!bOn && bDoAsk)
752         {
753             auto xDialog = std::make_shared<QuerySetInsModeDialog>(GetView().GetFrameWeld());
>>>     CID 1610243:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "this" is not initialized in this constructor nor in any functions that it calls.
754             weld::DialogController::runAsync(xDialog, [this, bOn, xDialog](sal_Int32 nResult){
755     
756                 std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
757                     comphelper::ConfigurationChanges::create());
758                 officecfg::Office::Common::Misc::QuerySetInsMode::set(!xDialog->GetDoNotShowAgain(), xChanges);
759                 xChanges->commit();

** CID 1610242:  Uninitialized members  (UNINIT_CTOR)
/sw/source/uibase/wrtsh/select.cxx: 754 in SwWrtShell::SetInsMode(bool)::[lambda(int) (instance 1)]::lambda([lambda(int) (instance 1)]&&)()


________________________________________________________________________________________________________
*** CID 1610242:  Uninitialized members  (UNINIT_CTOR)
/sw/source/uibase/wrtsh/select.cxx: 754 in SwWrtShell::SetInsMode(bool)::[lambda(int) (instance 1)]::lambda([lambda(int) (instance 1)]&&)()
748     void SwWrtShell::SetInsMode( bool bOn )
749     {
750         const bool bDoAsk = officecfg::Office::Common::Misc::QuerySetInsMode::get();
751         if (!bOn && bDoAsk)
752         {
753             auto xDialog = std::make_shared<QuerySetInsModeDialog>(GetView().GetFrameWeld());
>>>     CID 1610242:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "this" is not initialized in this constructor nor in any functions that it calls.
754             weld::DialogController::runAsync(xDialog, [this, bOn, xDialog](sal_Int32 nResult){
755     
756                 std::shared_ptr<comphelper::ConfigurationChanges> xChanges(
757                     comphelper::ConfigurationChanges::create());
758                 officecfg::Office::Common::Misc::QuerySetInsMode::set(!xDialog->GetDoNotShowAgain(), xChanges);
759                 xChanges->commit();

** CID 1610241:  Integer handling issues  (NEGATIVE_RETURNS)


________________________________________________________________________________________________________
*** CID 1610241:  Integer handling issues  (NEGATIVE_RETURNS)
/vcl/source/control/ivctrl.cxx: 539 in VerticalTabControl::RemovePage(std::basic_string_view<char16_t, std::char_traits<char16_t>>)()
533         for (auto it = maPageList.begin(), end = maPageList.end(); it != end; ++it)
534         {
535             VerticalTabPageData* pData = it->get();
536             if (pData->sId == rPageId)
537             {
538                 sal_Int32 nEntryListPos = m_xChooser->GetEntryListPos(pData->pEntry);
>>>     CID 1610241:  Integer handling issues  (NEGATIVE_RETURNS)
>>>     "nEntryListPos" is passed to a parameter that cannot be negative.
539                 m_xChooser->RemoveEntry(nEntryListPos);
540                 m_xChooser->ArrangeIcons();
541                 maPageList.erase(it);
542                 break;
543             }
544         }

** CID 1610240:  Null pointer dereferences  (FORWARD_NULL)
/desktop/source/lib/init.cxx: 3195 in lo_extractDocumentStructureRequest(_LibreOfficeKit *, const char *)()


________________________________________________________________________________________________________
*** CID 1610240:  Null pointer dereferences  (FORWARD_NULL)
/desktop/source/lib/init.cxx: 3195 in lo_extractDocumentStructureRequest(_LibreOfficeKit *, const char *)()
3189                     //if it is a writer document..
3190                     uno::Reference<lang::XServiceInfo> xDocument(xComp, uno::UNO_QUERY_THROW);
3191                     if (xDocument->supportsService(u"com.sun.star.text.TextDocument"_ustr) || xDocument->supportsService(u"com.sun.star.text.WebDocument"_ustr))
3192                     {
3193                         tools::JsonWriter aJson;
3194                         {
>>>     CID 1610240:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "pDoc" to "getCommandValues", which dereferences it. (The dereference happens because this is a virtual function call.)
3195                             pDoc->getCommandValues(aJson, ".uno:ExtractDocumentStructure");
3196                             //auto aNode = aJson.startNode("Controls");
3197                             //extractLinks(xLTS->getLinks(), false, aJson);
3198                         }
3199                         return convertOString(aJson.finishAndGetAsOString());
3200                     }


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2BKADyCpvUKOL6EWmZljiu6VvXBlQRUbS683tC8265rGNPXqJ1ffcoLZCnTuJFQbNcTEkb4XaEQkzovKhJ5DB3c-3DlJUh_A9M4dSy7guk8NP6DcfgslOyvJRzavztVIKj6nRqYjYpWom7SJFyX0y710bz0kUGtAZtC52NswyE8sbZtF2824btlZixS78TWEI625KrotNmYK9-2FNDCHerqPP-2FRvERXq59uAjn5SCruixNgGvuAIGEn-2BidzsYyuKqP8rU2-2ByGa2YlIKOA3YijSCtga2E-2BMel9-2BKRsQcTmu3sbjZicQCfV-2FCiJ-2But-2Fwcyxq9L4EXAklYw-3D



More information about the LibreOffice mailing list