New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Thu Jun 2 01:34:47 UTC 2022


Hi,

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

7 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 7 of 7 defect(s)


** CID 1504597:  Null pointer dereferences  (NULL_RETURNS)
/dbaccess/source/ui/dlg/dbadmin.cxx: 94 in dbaui::ODbAdminDialog::impl_selectDataSource(const com::sun::star::uno::Any &)()


________________________________________________________________________________________________________
*** CID 1504597:  Null pointer dereferences  (NULL_RETURNS)
/dbaccess/source/ui/dlg/dbadmin.cxx: 94 in dbaui::ODbAdminDialog::impl_selectDataSource(const com::sun::star::uno::Any &)()
88     void ODbAdminDialog::impl_selectDataSource(const css::uno::Any& _aDataSourceName)
89     {
90         m_pImpl->setDataSourceOrName(_aDataSourceName);
91         Reference< XPropertySet > xDatasource = m_pImpl->getCurrentDataSource();
92         impl_resetPages( xDatasource );
93     
>>>     CID 1504597:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "this->dbaui::ODbAdminDialog::getOutputSet()->GetItem(5, true)", which is known to be "nullptr".
94         const DbuTypeCollectionItem& rCollectionItem = dynamic_cast<const DbuTypeCollectionItem&>(*getOutputSet()->GetItem(DSID_TYPECOLLECTION));
95         ::dbaccess::ODsnTypeCollection* pCollection = rCollectionItem.getCollection();
96         ::dbaccess::DATASOURCE_TYPE eType = pCollection->determineType(getDatasourceType(*getOutputSet()));
97     
98         // and insert the new ones
99         switch ( eType )

** CID 1504596:  Null pointer dereferences  (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 1504596:  Null pointer dereferences  (FORWARD_NULL)
/dbaccess/source/ui/dlg/dbwizsetup.cxx: 139 in dbaui::ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(weld::Window *, const SfxItemSet *, const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> &, const com::sun::star::uno::Any &)()
133     
134         defaultButton(WizardButtonFlags::NEXT);
135         enableButtons(WizardButtonFlags::FINISH, true);
136         enableAutomaticNextButtonState();
137     
138         ::dbaccess::ODsnTypeCollection::TypeIterator aIter = m_pCollection->begin();
>>>     CID 1504596:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "this->m_pCollection" to "end", which dereferences it.
139         ::dbaccess::ODsnTypeCollection::TypeIterator aEnd = m_pCollection->end();
140         for(PathId i = 1;aIter != aEnd;++aIter,++i)
141         {
142             const OUString& sURLPrefix = aIter.getURLPrefix();
143             WizardPath aPath;
144             aPath.push_back(PAGE_DBSETUPWIZARD_INTRO);

** CID 1504595:  Null pointer dereferences  (NULL_RETURNS)
/dbaccess/source/ui/dlg/dbwiz.cxx: 80 in dbaui::ODbTypeWizDialog::ODbTypeWizDialog(weld::Window *, const SfxItemSet *, const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> &, const com::sun::star::uno::Any &)()


________________________________________________________________________________________________________
*** CID 1504595:  Null pointer dereferences  (NULL_RETURNS)
/dbaccess/source/ui/dlg/dbwiz.cxx: 80 in dbaui::ODbTypeWizDialog::ODbTypeWizDialog(weld::Window *, const SfxItemSet *, const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> &, const com::sun::star::uno::Any &)()
74         m_xPrevPage->set_help_id(HID_DBWIZ_PREVIOUS);
75         m_xNextPage->set_help_id(HID_DBWIZ_NEXT);
76         m_xCancel->set_help_id(HID_DBWIZ_CANCEL);
77         m_xFinish->set_help_id(HID_DBWIZ_FINISH);
78         // no local resources needed anymore
79     
>>>     CID 1504595:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "_pItems->GetItem(5, true)", which is known to be "nullptr".
80         const DbuTypeCollectionItem& rCollectionItem = dynamic_cast<const DbuTypeCollectionItem&>(*_pItems->GetItem(DSID_TYPECOLLECTION));
81         m_pCollection = rCollectionItem.getCollection();
82     
83         ActivatePage();
84         setTitleBase(DBA_RES(STR_DATABASE_TYPE_CHANGE));
85     

** CID 1504594:    (CONSTANT_EXPRESSION_RESULT)
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<short, short>(T1, T2)()
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<unsigned int, unsigned int>(T1, T2)()
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<unsigned long, unsigned long>(T1, T2)()
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<long, long>(T1, T2)()
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<signed char, signed char>(T1, T2)()
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<int, int>(T1, T2)()
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<unsigned short, unsigned short>(T1, T2)()


________________________________________________________________________________________________________
*** CID 1504594:    (CONSTANT_EXPRESSION_RESULT)
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<short, short>(T1, T2)()
31     using std::cmp_greater_equal;
32     
33     #else
34     
35     template <typename T1, typename T2> constexpr bool cmp_equal(T1 value1, T2 value2) noexcept
36     {
>>>     CID 1504594:    (CONSTANT_EXPRESSION_RESULT)
>>>     "1 /* std::is_signed_v<short> */ == 1 /* std::is_signed_v<short> */" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical operand of "if".
37         if constexpr (std::is_signed_v<T1> == std::is_signed_v<T2>)
38         {
39             return value1 == value2;
40         }
41         else if constexpr (std::is_signed_v<T1>)
42         {
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<unsigned int, unsigned int>(T1, T2)()
31     using std::cmp_greater_equal;
32     
33     #else
34     
35     template <typename T1, typename T2> constexpr bool cmp_equal(T1 value1, T2 value2) noexcept
36     {
>>>     CID 1504594:    (CONSTANT_EXPRESSION_RESULT)
>>>     "0 /* std::is_signed_v<unsigned int> */ == 0 /* std::is_signed_v<unsigned int> */" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical operand of "if".
37         if constexpr (std::is_signed_v<T1> == std::is_signed_v<T2>)
38         {
39             return value1 == value2;
40         }
41         else if constexpr (std::is_signed_v<T1>)
42         {
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<unsigned long, unsigned long>(T1, T2)()
31     using std::cmp_greater_equal;
32     
33     #else
34     
35     template <typename T1, typename T2> constexpr bool cmp_equal(T1 value1, T2 value2) noexcept
36     {
>>>     CID 1504594:    (CONSTANT_EXPRESSION_RESULT)
>>>     "0 /* std::is_signed_v<unsigned long> */ == 0 /* std::is_signed_v<unsigned long> */" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical operand of "if".
37         if constexpr (std::is_signed_v<T1> == std::is_signed_v<T2>)
38         {
39             return value1 == value2;
40         }
41         else if constexpr (std::is_signed_v<T1>)
42         {
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<long, long>(T1, T2)()
31     using std::cmp_greater_equal;
32     
33     #else
34     
35     template <typename T1, typename T2> constexpr bool cmp_equal(T1 value1, T2 value2) noexcept
36     {
>>>     CID 1504594:    (CONSTANT_EXPRESSION_RESULT)
>>>     "1 /* std::is_signed_v<long> */ == 1 /* std::is_signed_v<long> */" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical operand of "if".
37         if constexpr (std::is_signed_v<T1> == std::is_signed_v<T2>)
38         {
39             return value1 == value2;
40         }
41         else if constexpr (std::is_signed_v<T1>)
42         {
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<signed char, signed char>(T1, T2)()
31     using std::cmp_greater_equal;
32     
33     #else
34     
35     template <typename T1, typename T2> constexpr bool cmp_equal(T1 value1, T2 value2) noexcept
36     {
>>>     CID 1504594:    (CONSTANT_EXPRESSION_RESULT)
>>>     "1 /* std::is_signed_v<signed char> */ == 1 /* std::is_signed_v<signed char> */" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical operand of "if".
37         if constexpr (std::is_signed_v<T1> == std::is_signed_v<T2>)
38         {
39             return value1 == value2;
40         }
41         else if constexpr (std::is_signed_v<T1>)
42         {
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<int, int>(T1, T2)()
31     using std::cmp_greater_equal;
32     
33     #else
34     
35     template <typename T1, typename T2> constexpr bool cmp_equal(T1 value1, T2 value2) noexcept
36     {
>>>     CID 1504594:    (CONSTANT_EXPRESSION_RESULT)
>>>     "1 /* std::is_signed_v<int> */ == 1 /* std::is_signed_v<int> */" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical operand of "if".
37         if constexpr (std::is_signed_v<T1> == std::is_signed_v<T2>)
38         {
39             return value1 == value2;
40         }
41         else if constexpr (std::is_signed_v<T1>)
42         {
/include/o3tl/intcmp.hxx: 37 in o3tl::cmp_equal<unsigned short, unsigned short>(T1, T2)()
31     using std::cmp_greater_equal;
32     
33     #else
34     
35     template <typename T1, typename T2> constexpr bool cmp_equal(T1 value1, T2 value2) noexcept
36     {
>>>     CID 1504594:    (CONSTANT_EXPRESSION_RESULT)
>>>     "0 /* std::is_signed_v<unsigned short> */ == 0 /* std::is_signed_v<unsigned short> */" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical operand of "if".
37         if constexpr (std::is_signed_v<T1> == std::is_signed_v<T2>)
38         {
39             return value1 == value2;
40         }
41         else if constexpr (std::is_signed_v<T1>)
42         {

** CID 1504593:  Null pointer dereferences  (NULL_RETURNS)
/dbaccess/source/ui/dlg/dbadmin.cxx: 180 in dbaui::ODbAdminDialog::impl_resetPages(const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> &)()


________________________________________________________________________________________________________
*** CID 1504593:  Null pointer dereferences  (NULL_RETURNS)
/dbaccess/source/ui/dlg/dbadmin.cxx: 180 in dbaui::ODbAdminDialog::impl_resetPages(const com::sun::star::uno::Reference<com::sun::star::beans::XPropertySet> &)()
174     
175         // reset the example set
176         m_xExampleSet.reset(new SfxItemSet(*GetInputSetImpl()));
177     
178         // special case: MySQL Native does not have the generic "advanced" page
179     
>>>     CID 1504593:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "this->dbaui::ODbAdminDialog::getOutputSet()->GetItem(5, true)", which is known to be "nullptr".
180         const DbuTypeCollectionItem& rCollectionItem = dynamic_cast<const DbuTypeCollectionItem&>(*getOutputSet()->GetItem(DSID_TYPECOLLECTION));
181         ::dbaccess::ODsnTypeCollection* pCollection = rCollectionItem.getCollection();
182         if ( pCollection->determineType(getDatasourceType( *m_xExampleSet )) == ::dbaccess::DST_MYSQL_NATIVE )
183         {
184             OString sMySqlNative("mysqlnative");
185             AddTabPage(sMySqlNative, DBA_RES(STR_PAGETITLE_CONNECTION), ODriversSettings::CreateMySQLNATIVE);

** CID 1504592:  Performance inefficiencies  (PASS_BY_VALUE)
/sot/source/sdstor/stgdir.cxx: 56 in StgDirEntry::StgDirEntry(StgEntry)()


________________________________________________________________________________________________________
*** CID 1504592:  Performance inefficiencies  (PASS_BY_VALUE)
/sot/source/sdstor/stgdir.cxx: 56 in StgDirEntry::StgDirEntry(StgEntry)()
50     {
51         *pbOk = m_aEntry.Load( pBuffer, nBufferLen, nUnderlyingStreamSize );
52     
53         InitMembers();
54     }
55     
>>>     CID 1504592:  Performance inefficiencies  (PASS_BY_VALUE)
>>>     Passing parameter r of type "StgEntry" (size 136 bytes) by value.
56     StgDirEntry::StgDirEntry( StgEntry r ) :  m_aEntry(std::move( r ))
57     {
58         InitMembers();
59     }
60     
61     // Helper for all ctors

** CID 1504591:  Uninitialized members  (UNINIT_CTOR)
/vcl/jsdialog/jsdialogbuilder.cxx: 1790 in JSPopover::JSPopover(JSDialogSender *, DockingWindow *, SalInstanceBuilder *, bool)()


________________________________________________________________________________________________________
*** CID 1504591:  Uninitialized members  (UNINIT_CTOR)
/vcl/jsdialog/jsdialogbuilder.cxx: 1790 in JSPopover::JSPopover(JSDialogSender *, DockingWindow *, SalInstanceBuilder *, bool)()
1784     }
1785     
1786     JSPopover::JSPopover(JSDialogSender* pSender, DockingWindow* pDockingWindow,
1787                          SalInstanceBuilder* pBuilder, bool bTakeOwnership)
1788         : JSWidget<SalInstancePopover, DockingWindow>(pSender, pDockingWindow, pBuilder, bTakeOwnership)
1789     {
>>>     CID 1504591:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "mnWindowId" is not initialized in this constructor nor in any functions that it calls.
1790     }
1791     
1792     void JSPopover::popup_at_rect(weld::Widget* pParent, const tools::Rectangle& rRect,
1793                                   weld::Placement ePlace)
1794     {
1795         SalInstancePopover::popup_at_rect(pParent, rRect, ePlace);


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3Drnvl_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJihTSrsXgqdkazQ5f9BlpqTOWPocpSV-2BZCZynpdBoSO-2BABuuFslKL4gafXxE2nBx74F05nDZv78-2BFGT0h8E3Xy4eMrIlo9rF81I2mbFssVe9j9vwYU9Oec01kR5DQ6WPZNFa1ZorfvEaIUoe5UhXBkENYmOIhSFVh7QkG0DxLtWTg-3D



More information about the LibreOffice mailing list