Hi,

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

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


** CID 1692498:       Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/include/vcl/hatch.hxx: 46           in ()


_____________________________________________________________________________________________
*** CID 1692498:         Low impact quality  (MISSING_MOVE_ASSIGNMENT)
/include/vcl/hatch.hxx: 46             in ()
40     
41         ImplHatch();
42     
43         bool operator==( const ImplHatch& rImplHatch ) const;
44     };
45     
>>>     CID 1692498:         Low impact quality  (MISSING_MOVE_ASSIGNMENT)
>>>     Class "Hatch" 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.
46     class VCL_DLLPUBLIC Hatch
47     {
48     public:
49     
50                         Hatch();
51                         Hatch( const Hatch& rHatch );

** CID 1692497:       Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/sw/source/core/unocore/unostyle.cxx: 3939           in 
SwAutoStylesEnumImpl::SwAutoStylesEnumImpl(SwDoc &, 
IStyleAccess::SwAutoStyleFamily)()


_____________________________________________________________________________________________
*** CID 1692497:         Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/sw/source/core/unocore/unostyle.cxx: 3939             in 
SwAutoStylesEnumImpl::SwAutoStylesEnumImpl(SwDoc &, 
IStyleAccess::SwAutoStyleFamily)()
3933                     const SwFormatRuby& rRubyItem = pTextAttr->GetRuby();
3934                     std::pair< sal_uInt16, text::RubyAdjust > aPair( 
rRubyItem.GetPosition(), rRubyItem.GetAdjustment() );
3935                     if ( aRubyMap.insert( aPair ).second )
3936                     {
3937                         auto pItemSet = 
std::make_shared<SfxItemSet>(SfxItemSet::makeFixedSfxItemSet<RES_TXTATR_CJK_RUBY,
 RES_TXTATR_CJK_RUBY>( rAttrPool ));
3938                         pItemSet->Put( rRubyItem );
>>>     CID 1692497:         Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "pItemSet" is copied and then passed-by-reference as parameter to STL 
>>> insertion function "std::vector<std::shared_ptr<SfxItemSet>, 
>>> std::allocator<std::shared_ptr<SfxItemSet> > 
>>> >::push_back(std::vector<std::shared_ptr<SfxItemSet>, 
>>> std::allocator<std::shared_ptr<SfxItemSet> > >::value_type const &)", when 
>>> it could be moved instead.
3939                         mAutoStyles.push_back( pItemSet );
3940                     }
3941                 }
3942             }
3943         }
3944         else

** CID 1692496:         (CHECKED_RETURN)
/vcl/unx/generic/fontmanager/fontconfig.cxx: 746           in 
psp::PrintFontManager::countFontconfigFonts()()
/vcl/unx/generic/fontmanager/fontconfig.cxx: 754           in 
psp::PrintFontManager::countFontconfigFonts()()


_____________________________________________________________________________________________
*** CID 1692496:           (CHECKED_RETURN)
/vcl/unx/generic/fontmanager/fontconfig.cxx: 746             in 
psp::PrintFontManager::countFontconfigFonts()()
740     
741             for( int i = 0; i < pFSet->nfont; i++ )
742             {
743                 if (bMinimalFontset)
744                 {
745                     FcChar8* family = nullptr;
>>>     CID 1692496:           (CHECKED_RETURN)
>>>     Calling "FcPatternGetString" without checking return value (as is done 
>>> elsewhere 14 out of 17 times).
746                     FcPatternGetString(pFSet->fonts[i], FC_FAMILY, 0, 
&family);
747                     if (family && strncmp(reinterpret_cast<char*>(family), 
"Liberation", strlen("Liberation")))
748                         continue;
749                 }
750     
751                 if (isPreviouslyDuplicateOrObsoleted(pFSet, i))
/vcl/unx/generic/fontmanager/fontconfig.cxx: 754             in 
psp::PrintFontManager::countFontconfigFonts()()
748                         continue;
749                 }
750     
751                 if (isPreviouslyDuplicateOrObsoleted(pFSet, i))
752                 {
753                     FcChar8* file = nullptr;
>>>     CID 1692496:           (CHECKED_RETURN)
>>>     Calling "FcPatternGetString" without checking return value (as is done 
>>> elsewhere 14 out of 17 times).
754                     FcPatternGetString(pFSet->fonts[i], FC_FILE, 0, &file);
755                     SAL_INFO("vcl.fonts.detail", "Ditching " << file << " 
as duplicate/obsolete");
756                     continue;
757                 }
758     
759                 auto oFont = fontFromFcPattern(pFSet->fonts[i]);

** CID 1692495:       Incorrect expression  (DIVIDE_BY_ZERO)
/drawinglayer/source/tools/emfppen.cxx: 258           in 
emfplushelper::EMFPPen::Read(SvMemoryStream &, const 
emfplushelper::EmfPlusHelperData &, unsigned int, bool)()


_____________________________________________________________________________________________
*** CID 1692495:         Incorrect expression  (DIVIDE_BY_ZERO)
/drawinglayer/source/tools/emfppen.cxx: 258             in 
emfplushelper::EMFPPen::Read(SvMemoryStream &, const 
emfplushelper::EmfPlusHelperData &, unsigned int, bool)()
252                 // EMF+ JoinTypeMiterClipped is working as our 
B2DLineJoin::Miter
253                 // For EMF+ LineJoinTypeMiter we are simulating it by 
changing angle
254                 if (lineJoin == EmfPlusLineJoinTypeMiter)
255                     miterLimit = 3.0 * miterLimit;
256                 // asin angle must be in range [-1, 1]
257                 if (abs(miterLimit) > 1.0)
>>>     CID 1692495:         Incorrect expression  (DIVIDE_BY_ZERO)
>>>     In expression "1. / miterLimit", division by expression "miterLimit" 
>>> which may be zero has undefined behavior.
258                     fMiterMinimumAngle = 2.0 * asin(1.0 / miterLimit);
259                 else
260                     // enable miter limit for all angles
261                     fMiterMinimumAngle = basegfx::deg2rad(180.0);
262                 SAL_INFO("drawinglayer.emf",
263                          "EMF+\t\t MiterLimit: " << std::dec << miterLimit

** CID 1692494:       Error handling issues  (NEGATIVE_RETURNS)
/sd/source/ui/dlg/sdpreslt.cxx: 125           in 
SdPresLayoutDlg::GetAttr(SfxItemSet &)()


_____________________________________________________________________________________________
*** CID 1692494:         Error handling issues  (NEGATIVE_RETURNS)
/sd/source/ui/dlg/sdpreslt.cxx: 125             in 
SdPresLayoutDlg::GetAttr(SfxItemSet &)()
119         rOutAttrs.Put( SfxBoolItem( ATTR_PRESLAYOUT_LOAD, bLoad ) );
120     
121         OUString aLayoutName;
122     
123         if( bLoad )
124         {
>>>     CID 1692494:         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.]
125             aLayoutName = maName + "#" + maLayoutNames.at(nIndex);
126         }
127         else if (nIndex >= 0)
128         {
129             aLayoutName = maLayoutNames.at(nIndex);
130             if( aLayoutName == maStrNone )

** CID 1692493:       Integer handling issues  (NEGATIVE_RETURNS)


_____________________________________________________________________________________________
*** CID 1692493:         Integer handling issues  (NEGATIVE_RETURNS)
/chart2/source/controller/dialogs/tp_Scale.cxx: 158             in 
chart::ScaleTabPage::EnableControls()()
152     
153         bool bWasDateAxis = m_xMt_MainDateStep->get_visible();
154         if( bWasDateAxis != bDateAxis )
155         {
156             //transport value from one to other control
157             if( bWasDateAxis )
>>>     CID 1692493:         Integer handling issues  (NEGATIVE_RETURNS)
>>>     "this->m_xMt_MainDateStep->get_value()" is passed to a parameter that 
>>> cannot be negative.
158                 lcl_setValue( *m_xFmtFldStepMain, 
m_xMt_MainDateStep->get_value() );
159             else
160                 
m_xMt_MainDateStep->set_value(m_xFmtFldStepMain->GetFormatter().GetValue());
161         }
162     
163         m_xFmtFldStepMain->set_visible( bValueAxis && !bDateAxis );

** CID 1692492:       Uninitialized members  (UNINIT_CTOR)
/vcl/inc/CoordinateMapper.hxx: 30           in 
CoordinateMapper::CoordinateMapper()()


_____________________________________________________________________________________________
*** CID 1692492:         Uninitialized members  (UNINIT_CTOR)
/vcl/inc/CoordinateMapper.hxx: 30             in 
CoordinateMapper::CoordinateMapper()()
24     #include <vcl/dllapi.h>
25     
26     class CoordinateMapper
27     {
28     private:
29         sal_Int32 mnDPIX;
>>>     CID 1692492:         Uninitialized members  (UNINIT_CTOR)
>>>     The compiler-generated constructor for this class does not initialize 
>>> "mnDPIY".
30         sal_Int32 mnDPIY;
31         sal_Int32 mnDPIScalePercentage = 100;
32     
33     public:
34         sal_Int32 GetDPIX() const;
35         sal_Int32 GetDPIY() const;

** CID 1692491:       Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/sw/source/uibase/app/docsh2.cxx: 1134           in 
SwDocShell::Execute(SfxRequest &)()


_____________________________________________________________________________________________
*** CID 1692491:         Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/sw/source/uibase/app/docsh2.cxx: 1134             in 
SwDocShell::Execute(SfxRequest &)()
1128                             {
1129                                 const SwTextFormatColl* pSplitColl = 
nullptr;
1130                                 if ( !aTemplateName.isEmpty() )
1131                                     pSplitColl = 
m_xDoc->FindTextFormatCollByName(UIName(aTemplateName));
1132                                 bDone = bCreateHtml
1133                                     ? m_xDoc->GenerateHTMLDoc(aFileName, 
pSplitColl, aConcatFunc)
>>>     CID 1692491:         Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "aConcatFunc" is passed-by-value as parameter to 
>>> "std::function<rtl::OUString (rtl::OUString, 
>>> rtl::OUString)>::function(std::function<rtl::OUString (rtl::OUString, 
>>> rtl::OUString)> const &)", when it could be moved instead.
1134                                     : m_xDoc->GenerateGlobalDoc(aFileName, 
pSplitColl, aConcatFunc);
1135                             }
1136                             if( bDone )
1137                             {
1138                                 SfxStringItem aName( SID_FILE_NAME, 
aFileName );
1139                                 SfxStringItem aReferer(SID_REFERER, 
OUString());

** CID 1692490:       Memory - corruptions  (MISMATCHED_ITERATOR)
/usr/include/c++/14/bits/erase_if.h: 57           in 
std::__detail::__erase_nodes_if<std::unordered_map<rtl::OUString, 
std::unique_ptr<ScTableStyle, std::default_delete<ScTableStyle>>, 
std::hash<rtl::OUString>, std::equal_to<rtl::OUString>, 
std::allocator<std::pair<const rtl::OUString, std::unique_ptr<ScTableStyle, 
std::default_delete<ScTableStyle>>>>>, std::unordered_map<rtl::OUString, 
std::unique_ptr<ScTableStyle, std::default_delete<ScTableStyle>>, 
std::hash<rtl::OUString>, std::equal_to<rtl::OUString>, 
std::allocator<std::pair<const rtl::OUString, std::unique_ptr<ScTableStyle, 
std::default_delete<ScTableStyle>>>>>, 
ScTableStyles::ClearOOXMLDefaultStyles()::[lambda(const T1 &) (instance 1)]>(T1 
&, T2 &, T3)()


_____________________________________________________________________________________________
*** CID 1692490:         Memory - corruptions  (MISMATCHED_ITERATOR)
/usr/include/c++/14/bits/erase_if.h: 57             in 
std::__detail::__erase_nodes_if<std::unordered_map<rtl::OUString, 
std::unique_ptr<ScTableStyle, std::default_delete<ScTableStyle>>, 
std::hash<rtl::OUString>, std::equal_to<rtl::OUString>, 
std::allocator<std::pair<const rtl::OUString, std::unique_ptr<ScTableStyle, 
std::default_delete<ScTableStyle>>>>>, std::unordered_map<rtl::OUString, 
std::unique_ptr<ScTableStyle, std::default_delete<ScTableStyle>>, 
std::hash<rtl::OUString>, std::equal_to<rtl::OUString>, 
std::allocator<std::pair<const rtl::OUString, std::unique_ptr<ScTableStyle, 
std::default_delete<ScTableStyle>>>>>, 
ScTableStyles::ClearOOXMLDefaultStyles()::[lambda(const T1 &) (instance 1)]>(T1 
&, T2 &, T3)()
51      typename _Container::size_type __num = 0;
52      for (auto __iter = __ucont.begin(), __last = __ucont.end();
53           __iter != __last;)
54        {
55          if (__pred(*__iter))
56            {
>>>     CID 1692490:         Memory - corruptions  (MISMATCHED_ITERATOR)
>>>     Using iterator "__iter" from "__ucont" with "__cont".
57              __iter = __cont.erase(__iter);
58              ++__num;
59            }
60          else
61            ++__iter;
62        }

** CID 1692489:       Null pointer dereferences  (NULL_RETURNS)


_____________________________________________________________________________________________
*** CID 1692489:         Null pointer dereferences  (NULL_RETURNS)
/vcl/inc/unx/fontmanager.hxx: 144             in 
psp::PrintFontManager::getFontFileSysPath(int) const()
138     
139         // routines to get font info in small pieces
140     
141         // get a specific fonts system dependent filename
142         OString getFontFileSysPath( fontID nFontID ) const
143         {
>>>     CID 1692489:         Null pointer dereferences  (NULL_RETURNS)
>>>     Dereferencing a pointer that might be "nullptr" 
>>> "this->getFont(nFontID)->m_aFontFile" when calling "OString".
144             return getFont( nFontID )->m_aFontFile;
145         }
146     
147         // get the ttc face number
148         int getFontFaceNumber( fontID nFontID ) const;
149     

** CID 1620224:       Control flow issues  (MISMATCHED_ITERATOR)
/usr/include/c++/14/bits/erase_if.h: 52           in 
std::__detail::__erase_nodes_if<std::map<mds_gid_t, int, std::less<mds_gid_t>, 
std::allocator<std::pair<const mds_gid_t, int>>>, std::map<mds_gid_t, int, 
std::less<mds_gid_t>, std::allocator<std::pair<const mds_gid_t, int>>>, 
FSMap::filter(const std::vector<std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char>>, 
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, 
std::allocator<char>>>> &)::[lambda(const T1 &) (instance 2)]>(T1 &, T2 &, T3)()


_____________________________________________________________________________________________
*** CID 1620224:         Control flow issues  (MISMATCHED_ITERATOR)
/usr/include/c++/14/bits/erase_if.h: 52             in 
std::__detail::__erase_nodes_if<std::map<mds_gid_t, int, std::less<mds_gid_t>, 
std::allocator<std::pair<const mds_gid_t, int>>>, std::map<mds_gid_t, int, 
std::less<mds_gid_t>, std::allocator<std::pair<const mds_gid_t, int>>>, 
FSMap::filter(const std::vector<std::__cxx11::basic_string<char, 
std::char_traits<char>, std::allocator<char>>, 
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, 
std::allocator<char>>>> &)::[lambda(const T1 &) (instance 2)]>(T1 &, T2 &, T3)()
46           typename _Predicate>
47           typename _Container::size_type
48           __erase_nodes_if(_Container& __cont, _UnsafeContainer& __ucont,
49                     _Predicate __pred)
50           {
51      typename _Container::size_type __num = 0;
>>>     CID 1620224:         Control flow issues  (MISMATCHED_ITERATOR)
>>>     Comparing "__iter" from "__cont" to "__last" from "__ucont".
52      for (auto __iter = __ucont.begin(), __last = __ucont.end();
53           __iter != __last;)
54        {
55          if (__pred(*__iter))
56            {
57              __iter = __cont.erase(__iter);


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

Reply via email to