New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Sun Jun 5 04:58:12 UTC 2022


Hi,

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

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


** CID 1504667:  Resource leaks  (CTOR_DTOR_LEAK)


________________________________________________________________________________________________________
*** CID 1504667:  Resource leaks  (CTOR_DTOR_LEAK)
/usr/include/c++/10/bits/hashtable.h: 534 in std::_Hashtable<TranslateId, std::pair<const TranslateId, std::pair<const std::tuple<std::basic_string_view<char, std::char_traits<char>>, TranslateId, std::basic_string_view<char16_t, std::char_traits<char16_t>>, TranslateId> *, unsigned long>>, std::allocator<std::pair<const TranslateId, std::pair<const std::tuple<std::basic_string_view<char, std::char_traits<char>>, TranslateId, std::basic_string_view<char16_t, std::char_traits<char16_t>>, TranslateId> *, unsigned long>>>, std::__detail::_Select1st, std::equal_to<TranslateId>, <unnamed>::TranslateId_hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<(bool)1, (bool)0, (bool)1>>::_Hashtable(std::initializer_list<std::pair<const TranslateId, std::pair<const std::tuple<std::basic_string_view<char, std::char_traits<char>>, TranslateId, std::basic_string_view<char16_t, std::char_traits<char16_t>>, TranslateId> *, unsigned long>>>, unsigned long, const <unnamed>::TranslateId_hash &, const std::equal_to<TranslateId> &, const std::allocator<std::pair<const TranslateId, std::pair<const std::tuple<std::basic_string_view<char, std::char_traits<char>>, TranslateId, std::basic_string_view<char16_t, std::char_traits<char16_t>>, TranslateId> *, unsigned long>>>&)()
528     
529           _Hashtable(initializer_list<value_type> __l,
530     		 size_type __bkt_count_hint = 0,
531     		 const _H1& __hf = _H1(),
532     		 const key_equal& __eql = key_equal(),
533     		 const allocator_type& __a = allocator_type())
>>>     CID 1504667:  Resource leaks  (CTOR_DTOR_LEAK)
>>>     Calling allocation function "_Hashtable".
534           : _Hashtable(__l.begin(), __l.end(), __bkt_count_hint,
535     		   __hf, _H2(), _Hash(), __eql,
536     		   __key_extract(), __a)
537           { }
538     
539           _Hashtable&

** CID 1504666:  Null pointer dereferences  (NULL_RETURNS)
/dbaccess/source/ui/dlg/dbwizsetup.cxx: 120 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 &)()


________________________________________________________________________________________________________
*** CID 1504666:  Null pointer dereferences  (NULL_RETURNS)
/dbaccess/source/ui/dlg/dbwizsetup.cxx: 120 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 &)()
114         , m_pGeneralPage( nullptr )
115         , m_pMySQLIntroPage( nullptr )
116         , m_pFinalPage( nullptr )
117     {
118         // no local resources needed anymore
119         // extract the datasource type collection from the item set
>>>     CID 1504666:  Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing "_pItems->GetItem(5, true)", which is known to be "nullptr".
120         const DbuTypeCollectionItem& rCollectionItem = dynamic_cast<const DbuTypeCollectionItem&>(*_pItems->GetItem(DSID_TYPECOLLECTION));
121         m_pCollection = rCollectionItem.getCollection();
122     
123         assert(m_pCollection && "ODbTypeWizDialogSetup::ODbTypeWizDialogSetup : really need a DSN type collection !");
124     
125         m_pImpl.reset(new ODbDataSourceAdministrationHelper(_rxORB, m_xAssistant.get(), _pParent, this));

** CID 1504665:  Performance inefficiencies  (PASS_BY_VALUE)
/cppcanvas/source/mtfrenderer/polypolyaction.cxx: 258 in cppcanvas::internal::<unnamed>::TexturedPolyPolyAction::TexturedPolyPolyAction(const basegfx::B2DPolyPolygon &, const std::shared_ptr<cppcanvas::Canvas> &, const cppcanvas::internal::OutDevState &, com::sun::star::rendering::Texture)()


________________________________________________________________________________________________________
*** CID 1504665:  Performance inefficiencies  (PASS_BY_VALUE)
/cppcanvas/source/mtfrenderer/polypolyaction.cxx: 258 in cppcanvas::internal::<unnamed>::TexturedPolyPolyAction::TexturedPolyPolyAction(const basegfx::B2DPolyPolygon &, const std::shared_ptr<cppcanvas::Canvas> &, const cppcanvas::internal::OutDevState &, com::sun::star::rendering::Texture)()
252                     const rendering::Texture                            maTexture;
253                 };
254     
255                 TexturedPolyPolyAction::TexturedPolyPolyAction( const ::basegfx::B2DPolyPolygon& rPolyPoly,
256                                                                 const CanvasSharedPtr&           rCanvas,
257                                                                 const OutDevState&               rState,
>>>     CID 1504665:  Performance inefficiencies  (PASS_BY_VALUE)
>>>     Passing parameter aTexture of type "com::sun::star::rendering::Texture" (size 136 bytes) by value.
258                                                                 rendering::Texture               aTexture ) :
259                     CachedPrimitiveBase( rCanvas, true ),
260                     mxPolyPoly( ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon( rCanvas->getUNOCanvas()->getDevice(), rPolyPoly) ),
261                     maBounds( ::basegfx::utils::getRange(rPolyPoly) ),
262                     mpCanvas( rCanvas ),
263                     maTexture(std::move( aTexture ))

** CID 1504664:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)
/include/o3tl/safeint.hxx: 214 in o3tl::clamp_to_unsigned<unsigned long, unsigned int>(T2)()


________________________________________________________________________________________________________
*** CID 1504664:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)
/include/o3tl/safeint.hxx: 214 in o3tl::clamp_to_unsigned<unsigned long, unsigned int>(T2)()
208         return value;
209     }
210     
211     template<typename T1, typename T2> constexpr std::enable_if_t<std::is_unsigned_v<T1>, T1>
212     clamp_to_unsigned(T2 value) {
213         if constexpr (std::is_unsigned_v<T2>) {
>>>     CID 1504664:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT)
>>>     "value <= 18446744073709551615UL /* std::numeric_limits<unsigned long>::max() */" is always true regardless of the values of its operands. This occurs as the logical first operand of "?:".
214             return value <= std::numeric_limits<T1>::max() ? value : std::numeric_limits<T1>::max();
215         } else {
216             static_assert(std::is_signed_v<T2>);
217             return value < 0 ? 0 : clamp_to_unsigned<T1>(make_unsigned(value));
218         }
219     }

** CID 1504663:  Resource leaks  (CTOR_DTOR_LEAK)


________________________________________________________________________________________________________
*** CID 1504663:  Resource leaks  (CTOR_DTOR_LEAK)
/usr/include/c++/10/bits/hashtable.h: 1064 in std::_Hashtable<TranslateId, std::pair<const TranslateId, std::pair<const std::tuple<std::basic_string_view<char, std::char_traits<char>>, TranslateId, std::basic_string_view<char16_t, std::char_traits<char16_t>>, TranslateId> *, unsigned long>>, std::allocator<std::pair<const TranslateId, std::pair<const std::tuple<std::basic_string_view<char, std::char_traits<char>>, TranslateId, std::basic_string_view<char16_t, std::char_traits<char16_t>>, TranslateId> *, unsigned long>>>, std::__detail::_Select1st, std::equal_to<TranslateId>, <unnamed>::TranslateId_hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<(bool)1, (bool)0, (bool)1>>::_Hashtable<const std::pair<const TranslateId, std::pair<const std::tuple<std::basic_string_view<char, std::char_traits<char>>, TranslateId, std::basic_string_view<char16_t, std::char_traits<char16_t>>, TranslateId> *, unsigned long>> *>(T1, T1, unsigned long, const <unnamed>::TranslateId_hash &, const std::__detail::_Mod_range_hashing &, const std::__detail::_Default_ranged_hash &, const std::equal_to<TranslateId> &, const std::__detail::_Select1st &, const std::allocator<std::pair<const TranslateId, std::pair<const std::tuple<std::basic_string_view<char, std::char_traits<char>>, TranslateId, std::basic_string_view<char16_t, std::char_traits<char16_t>>, TranslateId> *, unsigned long>>>&)()
1058     	  _M_rehash_policy._M_next_bkt(
1059     	    std::max(_M_rehash_policy._M_bkt_for_elements(__nb_elems),
1060     		     __bkt_count_hint));
1061     
1062     	if (__bkt_count > _M_bucket_count)
1063     	  {
>>>     CID 1504663:  Resource leaks  (CTOR_DTOR_LEAK)
>>>     Calling allocation function "_M_allocate_buckets".
1064     	    _M_buckets = _M_allocate_buckets(__bkt_count);
1065     	    _M_bucket_count = __bkt_count;
1066     	  }
1067     
1068     	for (; __f != __l; ++__f)
1069     	  this->insert(*__f);


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypSs1kiFPuCn2xFdlMIFBirii0zZ9j2-2F9F2XPBcBm2BNgi9duPy3v-2FzgFDd2LJ-2BDKI-3DdPr2_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJi9PKpNUsrVF5trgg6kaiMUEGH4zpD6cS9rrQzvmzV7y1U53B773FB7IXO0HOaNl1EAID9GIZoSzZR-2BnLUZuQgC0LvStXvzzfQcy1-2Fx-2B1TMiZXKWyYjHN7IS48bpSTQK-2FXdHe8w6v5-2FAhZ2S-2FnDI4hlAftxddmOTTT9Z6E5uN1mo0-3D



More information about the LibreOffice mailing list