New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Tue Nov 12 06:43:13 UTC 2024


Hi,

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

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


** CID 1634639:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/sw/inc/swcrsr.hxx: 73 in ()


________________________________________________________________________________________________________
*** CID 1634639:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/sw/inc/swcrsr.hxx: 73 in ()
67         template<> struct typed_flags<SwCursorSkipMode> : is_typed_flags<SwCursorSkipMode, 0x3> {};
68     }
69     
70     /// SwCursor is a base class for UI/shell, table and UNO/API cursors.
71     ///
72     /// It's more than just a pair of doc model positions (SwPaM), e.g. can go left/right or up/down.
>>>     CID 1634639:  Low impact quality  (MISSING_MOVE_ASSIGNMENT)
>>>     Class "SwCursor" may benefit from adding a move assignment operator. See other events which show the copy assignment operator being applied to rvalues, where a move assignment may be faster.
73     class SAL_DLLPUBLIC_RTTI SwCursor : public SwPaM
74     {
75         friend class SwCursorSaveState;
76     
77         std::vector<SwCursor_SavePos> m_vSavePos; // the current entry is the last element
78         sal_Int32 m_nRowSpanOffset;        // required for travelling in tabs with rowspans

** CID 1634638:  Performance inefficiencies  (AUTO_CAUSES_COPY)
/sw/source/ui/misc/insfnote.cxx: 243 in SwInsFootNoteDlg::Init()()


________________________________________________________________________________________________________
*** CID 1634638:  Performance inefficiencies  (AUTO_CAUSES_COPY)
/sw/source/ui/misc/insfnote.cxx: 243 in SwInsFootNoteDlg::Init()()
237     
238         // Do not move the shell cursor; move a collapsed SwCursor created in the correct position.
239         // Moving a cursor with a mark will attempt to move only the point, thus a selection from
240         // outside of a table to inside of it could be possible, which would fail.
241         // bNext and bPrev are only false (simultaneously) for single-footnote documents, because
242         // GotoNextFootnoteAnchor / GotoPrevFootnoteAnchor may wrap.
>>>     CID 1634638:  Performance inefficiencies  (AUTO_CAUSES_COPY)
>>>     Using the "auto" keyword without an "&" causes the copy of an object of type "SwPosition".
243         const auto anchorPos = *m_rSh.GetCursor()->GetPoint();
244         SwCursor test(anchorPos, nullptr);
245         bool bNext = test.GotoNextFootnoteAnchor() && *test.GetPoint() != anchorPos;
246     
247         test = SwCursor(anchorPos, nullptr);
248         bool bPrev = test.GotoPrevFootnoteAnchor() && *test.GetPoint() != anchorPos;

** CID 1634637:  Integer handling issues  (NO_EFFECT)
/desktop/source/deployment/registry/configuration/dp_configuration.cxx: 594 in dp_registry::backend::configuration::<unnamed>::replaceOrigin(const rtl::OUString &, std::basic_string_view<char16_t, std::char_traits<char16_t>>, const com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> &, const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> &, bool &)()


________________________________________________________________________________________________________
*** CID 1634637:  Integer handling issues  (NO_EFFECT)
/desktop/source/deployment/registry/configuration/dp_configuration.cxx: 594 in dp_registry::backend::configuration::<unnamed>::replaceOrigin(const rtl::OUString &, std::basic_string_view<char16_t, std::char_traits<char16_t>>, const com::sun::star::uno::Reference<com::sun::star::ucb::XCommandEnvironment> &, const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> &, bool &)()
588                     break;
589                 index = nBytes;
590             } else {
591                 index = nCharIndex;
592             }
593     
>>>     CID 1634637:  Integer handling issues  (NO_EFFECT)
>>>     This greater-than-or-equal-to-zero comparison of an unsigned value is always true. "index >= 0UL".
594             assert(index >= 0 && index <= nBytes);
595     
596             if ((write_pos + index) > filtered.size())
597                 filtered.resize( (filtered.size() + index) * 2 );
598             memcpy( filtered.data() + write_pos, pBytes, index );
599             write_pos += index;


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=u001.AxU2LYlgjL6eX23u9ErQy-2BKADyCpvUKOL6EWmZljiu6VvXBlQRUbS683tC8265rGNPXqJ1ffcoLZCnTuJFQbNcTEkb4XaEQkzovKhJ5DB3c-3DCdCb_A9M4dSy7guk8NP6DcfgslOyvJRzavztVIKj6nRqYjYpWom7SJFyX0y710bz0kUGtPGSuS6ilKbAAWtiYTI0PdL612uARnQjKlnY42-2FHrWWxJVe2LH-2B4YOGam15AZdyVUlTcb0suv4PJK-2BlKtKuVvH55scXZMz91TVkFX7nLMlzAf0QXqHDWyvXCufP-2BrjTKKR31PV3g9Pnoc0KyJx-2Fs13fDwslOdK3vwyzGyP-2Fxhj3U-3D



More information about the LibreOffice mailing list