New Defects reported by Coverity Scan for LibreOffice
scan-admin at coverity.com
scan-admin at coverity.com
Mon Dec 8 05:24:21 PST 2014
Hi,
Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.
9 new defect(s) introduced to LibreOffice found with Coverity Scan.
7 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 9 of 9 defect(s)
** CID 1186125: Big parameter passed by value (PASS_BY_VALUE)
/usr/include/c++/4.8.3/bits/stl_algo.h: 4647 in std::count_if<__gnu_cxx::__normal_iterator<const boost::shared_ptr<slideshow::internal::ViewShape> *, std::vector<boost::shared_ptr<slideshow::internal::ViewShape>, std::allocator<boost::shared_ptr<slideshow::internal::ViewShape>>>>, boost::_bi::bind_t<bool, boost::_mfi::cmf4<bool, slideshow::internal::ViewShape, const boost::shared_ptr<GDIMetaFile> &, const slideshow::internal::ViewShape::RenderArgs &, int, bool>, boost::_bi::list5<boost::arg<(int)1>, boost::reference_wrapper<const boost::shared_ptr<GDIMetaFile>>, boost::_bi::value<slideshow::internal::ViewShape::RenderArgs>, boost::_bi::value<int>, boost::_bi::value<bool>>>>(T1, T1, T2)()
** CID 1257107: Unchecked dynamic_cast (FORWARD_NULL)
/sw/source/core/crsr/viscrs.cxx: 542 in SwShellCrsr::Show()()
** CID 1257108: Null pointer dereference (FORWARD_NULL)
/sw/source/core/draw/dpage.cxx: 98 in SwDPage::Clone(SdrModel *) const()
/sw/source/core/draw/dpage.cxx: 101 in SwDPage::Clone(SdrModel *) const()
** CID 1257109: Unchecked dynamic_cast (FORWARD_NULL)
/sw/source/core/draw/dpage.cxx: 84 in SwDPage::lateInit(const SwDPage&, SwDrawModel *)()
** CID 1257110: Big parameter passed by value (PASS_BY_VALUE)
/usr/include/boost/bind/bind.hpp: 1338 in boost::bind<bool, boost::_mfi::cmf4<bool, slideshow::internal::ViewShape, const boost::shared_ptr<GDIMetaFile> &, const slideshow::internal::ViewShape::RenderArgs &, int, bool>, boost::arg<(int)1>, boost::reference_wrapper<const boost::shared_ptr<GDIMetaFile>>, slideshow::internal::ViewShape::RenderArgs, int, bool>(T2, T3, T4, T5, T6, T7)()
** CID 1257111: Uninitialized pointer field (UNINIT_CTOR)
/sc/source/core/data/table3.cxx: 873 in <unnamed>::ListenerStartAction::ListenerStartAction(ScDocument &)()
** CID 1257112: Uninitialized scalar field (UNINIT_CTOR)
/sd/source/core/sdpage2.cxx: 405 in SdPage::SdPage(const SdPage&)()
** CID 1257113: Uninitialized scalar field (UNINIT_CTOR)
/desktop/source/lib/init.cxx: 267 in LibLibreOffice_Impl::LibLibreOffice_Impl()()
** CID 1257114: Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
/sc/qa/unit/ucalc.cxx: 4507 in Test::testAutoFillSimple()()
________________________________________________________________________________________________________
*** CID 1186125: Big parameter passed by value (PASS_BY_VALUE)
/usr/include/c++/4.8.3/bits/stl_algo.h: 4647 in std::count_if<__gnu_cxx::__normal_iterator<const boost::shared_ptr<slideshow::internal::ViewShape> *, std::vector<boost::shared_ptr<slideshow::internal::ViewShape>, std::allocator<boost::shared_ptr<slideshow::internal::ViewShape>>>>, boost::_bi::bind_t<bool, boost::_mfi::cmf4<bool, slideshow::internal::ViewShape, const boost::shared_ptr<GDIMetaFile> &, const slideshow::internal::ViewShape::RenderArgs &, int, bool>, boost::_bi::list5<boost::arg<(int)1>, boost::reference_wrapper<const boost::shared_ptr<GDIMetaFile>>, boost::_bi::value<slideshow::internal::ViewShape::RenderArgs>, boost::_bi::value<int>, boost::_bi::value<bool>>>>(T1, T1, T2)()
4641 * @param __pred A predicate.
4642 * @return The number of iterators @c i in the range @p [__first,__last)
4643 * for which @p __pred(*i) is true.
4644 */
4645 template<typename _InputIterator, typename _Predicate>
4646 typename iterator_traits<_InputIterator>::difference_type
>>> CID 1186125: Big parameter passed by value (PASS_BY_VALUE)
>>> Passing parameter __pred of type "boost::_bi::bind_t<bool, boost::_mfi::cmf4<bool, slideshow::internal::ViewShape, boost::shared_ptr<GDIMetaFile> const &, slideshow::internal::ViewShape::RenderArgs const &, int, bool>, boost::_bi::list5<boost::arg<1>, boost::reference_wrapper<boost::shared_ptr<GDIMetaFile> const>, boost::_bi::value<slideshow::internal::ViewShape::RenderArgs>, boost::_bi::value<int>, boost::_bi::value<bool> > >" (size 184 bytes) by value.
4647 count_if(_InputIterator __first, _InputIterator __last, _Predicate __pred)
4648 {
4649 // concept requirements
4650 __glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
4651 __glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
4652 typename iterator_traits<_InputIterator>::value_type>)
________________________________________________________________________________________________________
*** CID 1257107: Unchecked dynamic_cast (FORWARD_NULL)
/sw/source/core/crsr/viscrs.cxx: 542 in SwShellCrsr::Show()()
536 GetShell()->GetLayout()->CalcFrmRects( *this );
537 }
538
539 void SwShellCrsr::Show()
540 {
541 for(SwPaM& rTmp : GetRingContainer())
>>> CID 1257107: Unchecked dynamic_cast (FORWARD_NULL)
>>> Dynamic cast to pointer "dynamic_cast <SwShellCrsr *>(rTmp)" can return "NULL".
542 dynamic_cast<SwShellCrsr*>(&rTmp)->SwSelPaintRects::Show();
543 }
544
545 // This rectangle gets painted anew, therefore the SSelection in this
546 // area is invalid.
547 void SwShellCrsr::Invalidate( const SwRect& rRect )
________________________________________________________________________________________________________
*** CID 1257108: Null pointer dereference (FORWARD_NULL)
/sw/source/core/draw/dpage.cxx: 98 in SwDPage::Clone(SdrModel *) const()
92 return Clone( 0 );
93 }
94
95 SwDPage* SwDPage::Clone(SdrModel* const pNewModel) const
96 {
97 SwDPage* const pNewPage = new SwDPage( *this );
>>> CID 1257108: Null pointer dereference (FORWARD_NULL)
>>> Assigning: "pSwDrawModel" = "NULL".
98 SwDrawModel* pSwDrawModel = 0;
99 if ( pNewModel )
100 {
101 pSwDrawModel = dynamic_cast< SwDrawModel* >( pNewModel );
102 assert( pSwDrawModel );
103 }
/sw/source/core/draw/dpage.cxx: 101 in SwDPage::Clone(SdrModel *) const()
95 SwDPage* SwDPage::Clone(SdrModel* const pNewModel) const
96 {
97 SwDPage* const pNewPage = new SwDPage( *this );
98 SwDrawModel* pSwDrawModel = 0;
99 if ( pNewModel )
100 {
>>> CID 1257108: Null pointer dereference (FORWARD_NULL)
>>> Assigning: "pSwDrawModel" = "dynamic_cast <SwDrawModel *>(pNewModel)".
101 pSwDrawModel = dynamic_cast< SwDrawModel* >( pNewModel );
102 assert( pSwDrawModel );
103 }
104 pNewPage->lateInit( *this, pSwDrawModel );
105 return pNewPage;
106 }
________________________________________________________________________________________________________
*** CID 1257109: Unchecked dynamic_cast (FORWARD_NULL)
/sw/source/core/draw/dpage.cxx: 84 in SwDPage::lateInit(const SwDPage&, SwDrawModel *)()
78 {
79 FmFormPage::lateInit( rPage, pNewModel );
80
81 SwDrawModel* pSwDrawModel = pNewModel;
82 if ( !pModel )
83 {
>>> CID 1257109: Unchecked dynamic_cast (FORWARD_NULL)
>>> Assigning: "pSwDrawModel" = "dynamic_cast <SwDrawModel *>(this->GetModel())".
84 pSwDrawModel = dynamic_cast< SwDrawModel* >( GetModel() );
85 assert( pSwDrawModel );
86 }
87 pDoc = &pSwDrawModel->GetDoc();
88 }
89
________________________________________________________________________________________________________
*** CID 1257110: Big parameter passed by value (PASS_BY_VALUE)
/usr/include/boost/bind/bind.hpp: 1338 in boost::bind<bool, boost::_mfi::cmf4<bool, slideshow::internal::ViewShape, const boost::shared_ptr<GDIMetaFile> &, const slideshow::internal::ViewShape::RenderArgs &, int, bool>, boost::arg<(int)1>, boost::reference_wrapper<const boost::shared_ptr<GDIMetaFile>>, slideshow::internal::ViewShape::RenderArgs, int, bool>(T2, T3, T4, T5, T6, T7)()
1332 typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
1333 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
1334 }
1335
1336 template<class R, class F, class A1, class A2, class A3, class A4, class A5>
1337 _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
>>> CID 1257110: Big parameter passed by value (PASS_BY_VALUE)
>>> Passing parameter a3 of type "slideshow::internal::ViewShape::RenderArgs" (size 152 bytes) by value.
1338 BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
1339 {
1340 typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
1341 return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
1342 }
1343
________________________________________________________________________________________________________
*** CID 1257111: Uninitialized pointer field (UNINIT_CTOR)
/sc/source/core/data/table3.cxx: 873 in <unnamed>::ListenerStartAction::ListenerStartAction(ScDocument &)()
867 sc::EndListeningContext maEndCxt;
868
869 public:
870 ListenerStartAction( ScDocument& rDoc ) :
871 mpPosSet(new sc::ColumnBlockPositionSet(rDoc)),
872 maStartCxt(rDoc, mpPosSet),
>>> CID 1257111: Uninitialized pointer field (UNINIT_CTOR)
>>> Non-static class member "mpCol" is not initialized in this constructor nor in any functions that it calls.
873 maEndCxt(rDoc, mpPosSet) {}
874
875 virtual void startColumn( ScColumn* pCol ) SAL_OVERRIDE
876 {
877 mpCol = pCol;
878 }
________________________________________________________________________________________________________
*** CID 1257112: Uninitialized scalar field (UNINIT_CTOR)
/sd/source/core/sdpage2.cxx: 405 in SdPage::SdPage(const SdPage&)()
399 mbBackgroundFullSize = rSrcPage.mbBackgroundFullSize;
400 meCharSet = rSrcPage.meCharSet;
401 mnPaperBin = rSrcPage.mnPaperBin;
402 meOrientation = rSrcPage.meOrientation;
403
404 mpPageLink = NULL; // is set when inserting via ConnectLink()
>>> CID 1257112: Uninitialized scalar field (UNINIT_CTOR)
>>> Non-static class member "mbIsPrecious" is not initialized in this constructor nor in any functions that it calls.
405 }
406
407 void SdPage::lateInit(const SdPage& rSrcPage)
408 {
409 FmFormPage::lateInit(rSrcPage);
410
________________________________________________________________________________________________________
*** CID 1257113: Uninitialized scalar field (UNINIT_CTOR)
/desktop/source/lib/init.cxx: 267 in LibLibreOffice_Impl::LibLibreOffice_Impl()()
261 m_pOfficeClass->getError = lo_getError;
262
263 gOfficeClass = m_pOfficeClass;
264 }
265
266 pClass = m_pOfficeClass.get();
>>> CID 1257113: Uninitialized scalar field (UNINIT_CTOR)
>>> Non-static class member "maThread" is not initialized in this constructor nor in any functions that it calls.
267 }
268 };
269
270 namespace
271 {
272
________________________________________________________________________________________________________
*** CID 1257114: Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
/sc/qa/unit/ucalc.cxx: 4507 in Test::testAutoFillSimple()()
4501
4502 for(SCROW nRow = 0; nRow < 8; ++nRow)
4503 {
4504 if (nRow % 2 == 0)
4505 {
4506 double nVal = m_pDoc->GetValue(0, nRow, 0);
>>> CID 1257114: Result is not floating-point (UNINTENDED_INTEGER_DIVISION)
>>> Dividing integer expressions "nRow + 2" and "2", and then converting the integer quotient to type "double". Any remainder, or fractional part of the quotient, is ignored.
4507 CPPUNIT_ASSERT_EQUAL(double((nRow+2)/2), nVal);
4508 }
4509 else
4510 {
4511 OString aMsg = OString("wrong value in row: ") + OString::number(nRow);
4512 double nVal = m_pDoc->GetValue(0, nRow, 0);
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, http://scan.coverity.com/projects/211?tab=overview
To manage Coverity Scan email notifications for "libreoffice at lists.freedesktop.org", click http://scan.coverity.com/subscriptions/edit?email=libreoffice%40lists.freedesktop.org&token=d6481d718a775246b2340f282ebe5939 .
More information about the LibreOffice
mailing list