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


** CID 1676291:       Error handling issues  (NEGATIVE_RETURNS)
/extensions/source/dbpilots/groupboxwiz.cxx: 374           in 
dbp::OOptionValuesPage::implTraveledOptions()()


_____________________________________________________________________________________________
*** CID 1676291:         Error handling issues  (NEGATIVE_RETURNS)
/extensions/source/dbpilots/groupboxwiz.cxx: 374             in 
dbp::OOptionValuesPage::implTraveledOptions()()
368                 DBG_ASSERT(o3tl::make_unsigned(m_nLastSelection) < 
m_aUncommittedValues.size(), "OOptionValuesPage::implTraveledOptions: invalid 
previous selection index!");
369                 m_aUncommittedValues[m_nLastSelection] = 
m_xValue->get_text();
370             }
371     
372             m_nLastSelection = m_xOptions->get_selected_index();
373             DBG_ASSERT(o3tl::make_unsigned(m_nLastSelection) < 
m_aUncommittedValues.size(), "OOptionValuesPage::implTraveledOptions: invalid 
new selection index!");
>>>     CID 1676291:         Error handling issues  (NEGATIVE_RETURNS)
>>>     "this->m_nLastSelection" is passed to a parameter that cannot be 
>>> negative. [Note: The source code implementation of the function has been 
>>> overridden by a builtin model.]
374             m_xValue->set_text(m_aUncommittedValues[m_nLastSelection]);
375         }
376     
377         void OOptionValuesPage::initializePage()
378         {
379             OGBWPage::initializePage();

** CID 1676290:       Error handling issues  (NEGATIVE_RETURNS)
/cui/source/dialogs/cuigaldlg.cxx: 876           in 
TPGalleryThemeProperties::DoPreview()()


_____________________________________________________________________________________________
*** CID 1676290:         Error handling issues  (NEGATIVE_RETURNS)
/cui/source/dialogs/cuigaldlg.cxx: 876             in 
TPGalleryThemeProperties::DoPreview()()
870         int nIndex = m_xLbxFound->get_selected_index();
871         OUString aString(m_xLbxFound->get_text(nIndex));
872     
873         if (aString == aPreviewString)
874             return;
875     
>>>     CID 1676290:         Error handling issues  (NEGATIVE_RETURNS)
>>>     "nIndex" is passed to a parameter that cannot be negative. [Note: The 
>>> source code implementation of the function has been overridden by a builtin 
>>> model.]
876         INetURLObject _aURL(aFoundList[nIndex]);
877         bInputAllowed = false;
878     
879         if (!m_aWndPreview.SetGraphic(_aURL))
880         {
881             weld::WaitObject aWaitObject(GetFrameWeld());

** CID 1676289:         (NEGATIVE_RETURNS)


_____________________________________________________________________________________________
*** CID 1676289:           (NEGATIVE_RETURNS)
/sc/source/ui/miscdlgs/scuiautofmt.cxx: 362             in 
ScAutoFormatDlg::SelFmtHdl(weld::TreeView &)()
356         }
357     }
358     
359     IMPL_LINK_NOARG(ScAutoFormatDlg, SelFmtHdl, weld::TreeView&, void)
360     {
361         nIndex = m_xLbFormat->get_selected_index();
>>>     CID 1676289:           (NEGATIVE_RETURNS)
>>>     "this->nIndex" is passed to a parameter that cannot be negative.
362         UpdateChecks();
363     
364         if ( nIndex == 0 )
365         {
366             m_xBtnRename->set_sensitive(false);
367             m_xBtnRemove->set_sensitive(false);
/sc/source/ui/miscdlgs/scuiautofmt.cxx: 375             in 
ScAutoFormatDlg::SelFmtHdl(weld::TreeView &)()
369         else
370         {
371             m_xBtnRename->set_sensitive(true);
372             m_xBtnRemove->set_sensitive(true);
373         }
374     
>>>     CID 1676289:           (NEGATIVE_RETURNS)
>>>     "this->nIndex" is passed to a parameter that cannot be negative.
375         ScAutoFormatData* p = pFormat->findByIndex(nIndex);
376         m_aWndPreview.NotifyChange(p);
377     }
378     
379     OUString ScAutoFormatDlg::GetCurrFormatName()
380     {

** CID 1676288:       Integer handling issues  (NEGATIVE_RETURNS)


_____________________________________________________________________________________________
*** CID 1676288:         Integer handling issues  (NEGATIVE_RETURNS)
/sc/source/ui/optdlg/tpusrlst.cxx: 580             in 
ScTpUserLists::BtnClickHdl(weld::Button &)()
574                 sal_Int32 nSelList = mxLbLists->get_selected_index();
575     
576                 OSL_ENSURE( nSelList != -1 , "Modify without List :-/" );
577     
578                 if ( !theEntriesStr.isEmpty() )
579                 {
>>>     CID 1676288:         Integer handling issues  (NEGATIVE_RETURNS)
>>>     "nSelList" is passed to a parameter that cannot be negative.
580                     ModifyList( nSelList, theEntriesStr );
581                     UpdateUserListBox();
582                     mxLbLists->select( nSelList );
583                 }
584                 else
585                 {

** CID 1676287:       Integer handling issues  (NEGATIVE_RETURNS)


_____________________________________________________________________________________________
*** CID 1676287:         Integer handling issues  (NEGATIVE_RETURNS)
/sc/source/ui/cctrl/checklistmenu.cxx: 74             in 
ScCheckListMenuControl::RowActivatedHdl(weld::TreeView &)()
68     {
69         mpParent->handleMenuTimeout(this);
70     }
71     
72     IMPL_LINK_NOARG(ScCheckListMenuControl, RowActivatedHdl, 
weld::TreeView&, bool)
73     {
>>>     CID 1676287:         Integer handling issues  (NEGATIVE_RETURNS)
>>>     "this->mxMenu->get_selected_index()" is passed to a parameter that 
>>> cannot be negative.
74         executeMenuItem(mxMenu->get_selected_index());
75         return true;
76     }
77     
78     IMPL_LINK(ScCheckListMenuControl, MenuKeyInputHdl, const KeyEvent&, 
rKEvt, bool)
79     {

** CID 1676286:       High impact quality  (Y2K38_SAFETY)
/solenv/lockfile/lockfile.c: 211           in lockfilename()


_____________________________________________________________________________________________
*** CID 1676286:         High impact quality  (Y2K38_SAFETY)
/solenv/lockfile/lockfile.c: 211             in lockfilename()
205             if ((p = strrchr(tmplock, '/')) == NULL)
206                     p = tmplock;
207             else
208                     p++;
209             if (snprintf(p, TMPLOCKFILENAMESZ, "%s%0*d%0*x%s", TMPLOCKSTR,
210                             TMPLOCKPIDSZ, (int)getpid(),
>>>     CID 1676286:         High impact quality  (Y2K38_SAFETY)
>>>     A "time_t" value is stored in an integer with too few bits to 
>>> accommodate it.  The expression "time(NULL)" is cast to "int".
211                             TMPLOCKTIMESZ, (int)time(NULL) & 15,
212                             sysname) < 0) {
213                     // never happens but gets rid of gcc truncation warning.
214                     errno = EOVERFLOW;
215                     return L_ERROR;
216             }

** CID 1676285:       Integer handling issues  (NEGATIVE_RETURNS)


_____________________________________________________________________________________________
*** CID 1676285:         Integer handling issues  (NEGATIVE_RETURNS)
/sw/source/uibase/utlui/glbltree.cxx: 405             in 
SwGlobalTree::MoveSelectionTo(const weld::TreeIter *)()
399     {
400         int nSource = m_xTreeView->get_selected_index();
401     
402         int nDest = pDropEntry ? 
m_xTreeView->get_iter_index_in_parent(*pDropEntry)
403                                : m_pSwGlblDocContents->size();
404     
>>>     CID 1676285:         Integer handling issues  (NEGATIVE_RETURNS)
>>>     "nSource" is passed to a parameter that cannot be negative.
405         if (m_pActiveShell->MoveGlobalDocContent(
406                 *m_pSwGlblDocContents, nSource, nSource + 1, nDest ) &&
407                 Update( false ))
408             Display();
409     }
410     

** CID 1676284:       Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/sc/source/core/data/SheetView.cxx: 34           in 
sc::SortOrderReverser::addOrderIndices(const std::vector<int, 
std::allocator<int>> &, int, int)()


_____________________________________________________________________________________________
*** CID 1676284:         Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/sc/source/core/data/SheetView.cxx: 34             in 
sc::SortOrderReverser::addOrderIndices(const std::vector<int, 
std::allocator<int>> &, int, int)()
28             std::vector<SCCOLROW> newOrder(maOrder.size());
29             for (size_t nIndex = 0; nIndex < maOrder.size(); ++nIndex)
30             {
31                 size_t nSortedIndex = rOrder[nIndex];
32                 newOrder[nIndex] = maOrder[nSortedIndex - 1];
33             }
>>>     CID 1676284:         Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "newOrder" is copied in call to copy assignment for class 
>>> "std::vector<int, std::allocator<int> >", when it could be moved instead.
34             maOrder = newOrder;
35         }
36     }
37     
38     SCROW SortOrderReverser::unsort(SCROW nRow) const
39     {

** CID 1676283:       Error handling issues  (NEGATIVE_RETURNS)
/sw/source/ui/dbui/customizeaddresslistdialog.cxx: 134           in 
SwCustomizeAddressListDialog::UpDownHdl_Impl(weld::Button &)()


_____________________________________________________________________________________________
*** CID 1676283:         Error handling issues  (NEGATIVE_RETURNS)
/sw/source/ui/dbui/customizeaddresslistdialog.cxx: 134             in 
SwCustomizeAddressListDialog::UpDownHdl_Impl(weld::Button &)()
128             --nPos;
129         else
130             ++nPos;
131         m_xFieldsLB->insert_text(nPos, aTemp);
132         m_xFieldsLB->select(nPos);
133         //align m_xNewData
>>>     CID 1676283:         Error handling issues  (NEGATIVE_RETURNS)
>>>     "nOldPos" is passed to a parameter that cannot be negative. [Note: The 
>>> source code implementation of the function has been overridden by a builtin 
>>> model.]
134         OUString sHeader = m_xNewData->aDBColumnHeaders[nOldPos];
135         
m_xNewData->aDBColumnHeaders.erase(m_xNewData->aDBColumnHeaders.begin() + 
nOldPos);
136         
m_xNewData->aDBColumnHeaders.insert(m_xNewData->aDBColumnHeaders.begin() + 
nPos, sHeader);
137         for (auto& rData : m_xNewData->aDBData)
138         {
139             OUString sData = rData[nOldPos];

** CID 1584971:         (CONSTANT_EXPRESSION_RESULT)
/usr/include/c++/14/utility: 152           in std::cmp_less<short, short>(T1, 
T2)()
/usr/include/c++/14/utility: 152           in std::cmp_less<long, long>(T1, 
T2)()
/usr/include/c++/14/utility: 152           in std::cmp_less<unsigned short, 
unsigned short>(T1, T2)()
/usr/include/c++/14/utility: 152           in std::cmp_less<unsigned int, 
unsigned int>(T1, T2)()
/usr/include/c++/14/utility: 152           in std::cmp_less<unsigned char, 
unsigned char>(T1, T2)()
/usr/include/c++/14/utility: 152           in std::cmp_less<int, int>(T1, T2)()
/usr/include/c++/14/utility: 152           in std::cmp_less<unsigned long, 
unsigned long>(T1, T2)()


_____________________________________________________________________________________________
*** CID 1584971:           (CONSTANT_EXPRESSION_RESULT)
/usr/include/c++/14/utility: 152             in std::cmp_less<short, short>(T1, 
T2)()
146         constexpr bool
147         cmp_less(_Tp __t, _Up __u) noexcept
148         {
149           static_assert(__is_standard_integer<_Tp>::value);
150           static_assert(__is_standard_integer<_Up>::value);
151     
>>>     CID 1584971:           (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".
152           if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
153             return __t < __u;
154           else if constexpr (is_signed_v<_Tp>)
155             return __t < 0 || make_unsigned_t<_Tp>(__t) < __u;
156           else
157             return __u >= 0 && __t < make_unsigned_t<_Up>(__u);
/usr/include/c++/14/utility: 152             in std::cmp_less<long, long>(T1, 
T2)()
146         constexpr bool
147         cmp_less(_Tp __t, _Up __u) noexcept
148         {
149           static_assert(__is_standard_integer<_Tp>::value);
150           static_assert(__is_standard_integer<_Up>::value);
151     
>>>     CID 1584971:           (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".
152           if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
153             return __t < __u;
154           else if constexpr (is_signed_v<_Tp>)
155             return __t < 0 || make_unsigned_t<_Tp>(__t) < __u;
156           else
157             return __u >= 0 && __t < make_unsigned_t<_Up>(__u);
/usr/include/c++/14/utility: 152             in std::cmp_less<unsigned short, 
unsigned short>(T1, T2)()
146         constexpr bool
147         cmp_less(_Tp __t, _Up __u) noexcept
148         {
149           static_assert(__is_standard_integer<_Tp>::value);
150           static_assert(__is_standard_integer<_Up>::value);
151     
>>>     CID 1584971:           (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".
152           if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
153             return __t < __u;
154           else if constexpr (is_signed_v<_Tp>)
155             return __t < 0 || make_unsigned_t<_Tp>(__t) < __u;
156           else
157             return __u >= 0 && __t < make_unsigned_t<_Up>(__u);
/usr/include/c++/14/utility: 152             in std::cmp_less<unsigned int, 
unsigned int>(T1, T2)()
146         constexpr bool
147         cmp_less(_Tp __t, _Up __u) noexcept
148         {
149           static_assert(__is_standard_integer<_Tp>::value);
150           static_assert(__is_standard_integer<_Up>::value);
151     
>>>     CID 1584971:           (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".
152           if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
153             return __t < __u;
154           else if constexpr (is_signed_v<_Tp>)
155             return __t < 0 || make_unsigned_t<_Tp>(__t) < __u;
156           else
157             return __u >= 0 && __t < make_unsigned_t<_Up>(__u);
/usr/include/c++/14/utility: 152             in std::cmp_less<unsigned char, 
unsigned char>(T1, T2)()
146         constexpr bool
147         cmp_less(_Tp __t, _Up __u) noexcept
148         {
149           static_assert(__is_standard_integer<_Tp>::value);
150           static_assert(__is_standard_integer<_Up>::value);
151     
>>>     CID 1584971:           (CONSTANT_EXPRESSION_RESULT)
>>>     "0 /* std::is_signed_v<unsigned char> */ == 0 /* 
>>> std::is_signed_v<unsigned char> */" is always true regardless of the values 
>>> of its operands because those operands are identical. This occurs as the 
>>> logical operand of "if".
152           if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
153             return __t < __u;
154           else if constexpr (is_signed_v<_Tp>)
155             return __t < 0 || make_unsigned_t<_Tp>(__t) < __u;
156           else
157             return __u >= 0 && __t < make_unsigned_t<_Up>(__u);
/usr/include/c++/14/utility: 152             in std::cmp_less<int, int>(T1, 
T2)()
146         constexpr bool
147         cmp_less(_Tp __t, _Up __u) noexcept
148         {
149           static_assert(__is_standard_integer<_Tp>::value);
150           static_assert(__is_standard_integer<_Up>::value);
151     
>>>     CID 1584971:           (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".
152           if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
153             return __t < __u;
154           else if constexpr (is_signed_v<_Tp>)
155             return __t < 0 || make_unsigned_t<_Tp>(__t) < __u;
156           else
157             return __u >= 0 && __t < make_unsigned_t<_Up>(__u);
/usr/include/c++/14/utility: 152             in std::cmp_less<unsigned long, 
unsigned long>(T1, T2)()
146         constexpr bool
147         cmp_less(_Tp __t, _Up __u) noexcept
148         {
149           static_assert(__is_standard_integer<_Tp>::value);
150           static_assert(__is_standard_integer<_Up>::value);
151     
>>>     CID 1584971:           (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".
152           if constexpr (is_signed_v<_Tp> == is_signed_v<_Up>)
153             return __t < __u;
154           else if constexpr (is_signed_v<_Tp>)
155             return __t < 0 || make_unsigned_t<_Tp>(__t) < __u;
156           else
157             return __u >= 0 && __t < make_unsigned_t<_Up>(__u);


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, 
https://scan.coverity.com/projects/libreoffice?tab=overview

Reply via email to