New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Thu Dec 4 07:30:33 PST 2014


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.
1 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 1256663:  Same on both sides  (CONSTANT_EXPRESSION_RESULT)
/sw/inc/ring.hxx: 186 in sw::RingIterator<SwPaM>::equal(const sw::RingIterator<SwPaM>&) const()
/sw/inc/ring.hxx: 186 in sw::RingIterator<SwViewShell>::equal(const sw::RingIterator<SwViewShell>&) const()
/sw/inc/ring.hxx: 186 in sw::RingIterator<const SwPaM>::equal(const sw::RingIterator<const SwPaM>&) const()
/sw/inc/ring.hxx: 186 in sw::RingIterator<const SwViewShell>::equal(const sw::RingIterator<const SwViewShell>&) const()
/sw/inc/ring.hxx: 186 in sw::RingIterator<const <unnamed>::TestRing>::equal(const sw::RingIterator<const <unnamed>::TestRing>&) const()
/sw/inc/ring.hxx: 186 in sw::RingIterator<<unnamed>::TestRing>::equal(const sw::RingIterator<<unnamed>::TestRing>&) const()

** CID 1256665:  Division or modulo by float zero  (DIVIDE_BY_ZERO)
/vcl/opengl/program.cxx: 223 in OpenGLProgram::SetTransform(const rtl::OString &, const OpenGLTexture &, const basegfx::B2DPoint &, const basegfx::B2DPoint &, const basegfx::B2DPoint &)()
/vcl/opengl/program.cxx: 223 in OpenGLProgram::SetTransform(const rtl::OString &, const OpenGLTexture &, const basegfx::B2DPoint &, const basegfx::B2DPoint &, const basegfx::B2DPoint &)()

** CID 1256664:  Division or modulo by float zero  (DIVIDE_BY_ZERO)
/vcl/opengl/program.cxx: 223 in OpenGLProgram::SetTransform(const rtl::OString &, const OpenGLTexture &, const basegfx::B2DPoint &, const basegfx::B2DPoint &, const basegfx::B2DPoint &)()
/vcl/opengl/program.cxx: 223 in OpenGLProgram::SetTransform(const rtl::OString &, const OpenGLTexture &, const basegfx::B2DPoint &, const basegfx::B2DPoint &, const basegfx::B2DPoint &)()

** CID 1256669:  Uninitialized pointer field  (UNINIT_CTOR)
/sw/inc/ring.hxx: 62 in sw::Ring<SwViewShell>::Ring()()
/sw/inc/ring.hxx: 62 in sw::Ring<<unnamed>::TestRing>::Ring()()

** CID 1256668:  Uninitialized pointer field  (UNINIT_CTOR)
/sw/inc/ring.hxx: 112 in sw::Ring<SwPaM>::Ring(SwPaM *)()
/sw/inc/ring.hxx: 112 in sw::Ring<_SaveMergeRedlines>::Ring(_SaveMergeRedlines *)()
/sw/inc/ring.hxx: 112 in sw::Ring<SwViewShell>::Ring(SwViewShell *)()


________________________________________________________________________________________________________
*** CID 1256663:  Same on both sides  (CONSTANT_EXPRESSION_RESULT)
/sw/inc/ring.hxx: 186 in sw::RingIterator<SwPaM>::equal(const sw::RingIterator<SwPaM>&) const()
180                 }
181             private:
182                 friend class boost::iterator_core_access;
183                 void increment()
184                     { m_pCurrent = m_pCurrent ? m_pCurrent->GetNext() : m_pStart->GetNext(); }
185                 bool equal(RingIterator const& other) const
>>>     CID 1256663:  Same on both sides  (CONSTANT_EXPRESSION_RESULT)
>>>     "this->m_pStart == this->m_pStart" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical second operand of '&&'.
186                     { return m_pCurrent == other.m_pCurrent && m_pStart == m_pStart; }
187                 T& dereference() const
188                     { return m_pCurrent ? *m_pCurrent : * m_pStart; }
189                 T* m_pCurrent;
190                 T* m_pStart;
191         };
/sw/inc/ring.hxx: 186 in sw::RingIterator<SwViewShell>::equal(const sw::RingIterator<SwViewShell>&) const()
180                 }
181             private:
182                 friend class boost::iterator_core_access;
183                 void increment()
184                     { m_pCurrent = m_pCurrent ? m_pCurrent->GetNext() : m_pStart->GetNext(); }
185                 bool equal(RingIterator const& other) const
>>>     CID 1256663:  Same on both sides  (CONSTANT_EXPRESSION_RESULT)
>>>     "this->m_pStart == this->m_pStart" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical second operand of '&&'.
186                     { return m_pCurrent == other.m_pCurrent && m_pStart == m_pStart; }
187                 T& dereference() const
188                     { return m_pCurrent ? *m_pCurrent : * m_pStart; }
189                 T* m_pCurrent;
190                 T* m_pStart;
191         };
/sw/inc/ring.hxx: 186 in sw::RingIterator<const SwPaM>::equal(const sw::RingIterator<const SwPaM>&) const()
180                 }
181             private:
182                 friend class boost::iterator_core_access;
183                 void increment()
184                     { m_pCurrent = m_pCurrent ? m_pCurrent->GetNext() : m_pStart->GetNext(); }
185                 bool equal(RingIterator const& other) const
>>>     CID 1256663:  Same on both sides  (CONSTANT_EXPRESSION_RESULT)
>>>     "this->m_pStart == this->m_pStart" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical second operand of '&&'.
186                     { return m_pCurrent == other.m_pCurrent && m_pStart == m_pStart; }
187                 T& dereference() const
188                     { return m_pCurrent ? *m_pCurrent : * m_pStart; }
189                 T* m_pCurrent;
190                 T* m_pStart;
191         };
/sw/inc/ring.hxx: 186 in sw::RingIterator<const SwViewShell>::equal(const sw::RingIterator<const SwViewShell>&) const()
180                 }
181             private:
182                 friend class boost::iterator_core_access;
183                 void increment()
184                     { m_pCurrent = m_pCurrent ? m_pCurrent->GetNext() : m_pStart->GetNext(); }
185                 bool equal(RingIterator const& other) const
>>>     CID 1256663:  Same on both sides  (CONSTANT_EXPRESSION_RESULT)
>>>     "this->m_pStart == this->m_pStart" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical second operand of '&&'.
186                     { return m_pCurrent == other.m_pCurrent && m_pStart == m_pStart; }
187                 T& dereference() const
188                     { return m_pCurrent ? *m_pCurrent : * m_pStart; }
189                 T* m_pCurrent;
190                 T* m_pStart;
191         };
/sw/inc/ring.hxx: 186 in sw::RingIterator<const <unnamed>::TestRing>::equal(const sw::RingIterator<const <unnamed>::TestRing>&) const()
180                 }
181             private:
182                 friend class boost::iterator_core_access;
183                 void increment()
184                     { m_pCurrent = m_pCurrent ? m_pCurrent->GetNext() : m_pStart->GetNext(); }
185                 bool equal(RingIterator const& other) const
>>>     CID 1256663:  Same on both sides  (CONSTANT_EXPRESSION_RESULT)
>>>     "this->m_pStart == this->m_pStart" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical second operand of '&&'.
186                     { return m_pCurrent == other.m_pCurrent && m_pStart == m_pStart; }
187                 T& dereference() const
188                     { return m_pCurrent ? *m_pCurrent : * m_pStart; }
189                 T* m_pCurrent;
190                 T* m_pStart;
191         };
/sw/inc/ring.hxx: 186 in sw::RingIterator<<unnamed>::TestRing>::equal(const sw::RingIterator<<unnamed>::TestRing>&) const()
180                 }
181             private:
182                 friend class boost::iterator_core_access;
183                 void increment()
184                     { m_pCurrent = m_pCurrent ? m_pCurrent->GetNext() : m_pStart->GetNext(); }
185                 bool equal(RingIterator const& other) const
>>>     CID 1256663:  Same on both sides  (CONSTANT_EXPRESSION_RESULT)
>>>     "this->m_pStart == this->m_pStart" is always true regardless of the values of its operands because those operands are identical. This occurs as the logical second operand of '&&'.
186                     { return m_pCurrent == other.m_pCurrent && m_pStart == m_pStart; }
187                 T& dereference() const
188                     { return m_pCurrent ? *m_pCurrent : * m_pStart; }
189                 T* m_pCurrent;
190                 T* m_pStart;
191         };

________________________________________________________________________________________________________
*** CID 1256665:  Division or modulo by float zero  (DIVIDE_BY_ZERO)
/vcl/opengl/program.cxx: 223 in OpenGLProgram::SetTransform(const rtl::OString &, const OpenGLTexture &, const basegfx::B2DPoint &, const basegfx::B2DPoint &, const basegfx::B2DPoint &)()
217         const basegfx::B2DPoint& rX,
218         const basegfx::B2DPoint& rY )
219     {
220         GLuint nUniform = GetUniformLocation( rName );
221         const basegfx::B2DVector aXRel = rX - rNull;
222         const basegfx::B2DVector aYRel = rY - rNull;
>>>     CID 1256665:  Division or modulo by float zero  (DIVIDE_BY_ZERO)
>>>     In expression "(float)aYRel.getY() / rTexture->GetHeight()", division by expression "rTexture->GetHeight()" which may be zero has undefined behavior.
223         const float aValues[] = {
224             (float) aXRel.getX()/rTexture.GetWidth(),  (float) aXRel.getY()/rTexture.GetWidth(),  0, 0,
225             (float) aYRel.getX()/rTexture.GetHeight(), (float) aYRel.getY()/rTexture.GetHeight(), 0, 0,
226             0,                                         0,                                         1, 0,
227             (float) rNull.getX(),                      (float) rNull.getY(),                      0, 1 };
228         glm::mat4 mMatrix = glm::make_mat4( aValues );
/vcl/opengl/program.cxx: 223 in OpenGLProgram::SetTransform(const rtl::OString &, const OpenGLTexture &, const basegfx::B2DPoint &, const basegfx::B2DPoint &, const basegfx::B2DPoint &)()
217         const basegfx::B2DPoint& rX,
218         const basegfx::B2DPoint& rY )
219     {
220         GLuint nUniform = GetUniformLocation( rName );
221         const basegfx::B2DVector aXRel = rX - rNull;
222         const basegfx::B2DVector aYRel = rY - rNull;
>>>     CID 1256665:  Division or modulo by float zero  (DIVIDE_BY_ZERO)
>>>     In expression "(float)aYRel.getX() / rTexture->GetHeight()", division by expression "rTexture->GetHeight()" which may be zero has undefined behavior.
223         const float aValues[] = {
224             (float) aXRel.getX()/rTexture.GetWidth(),  (float) aXRel.getY()/rTexture.GetWidth(),  0, 0,
225             (float) aYRel.getX()/rTexture.GetHeight(), (float) aYRel.getY()/rTexture.GetHeight(), 0, 0,
226             0,                                         0,                                         1, 0,
227             (float) rNull.getX(),                      (float) rNull.getY(),                      0, 1 };
228         glm::mat4 mMatrix = glm::make_mat4( aValues );

________________________________________________________________________________________________________
*** CID 1256664:  Division or modulo by float zero  (DIVIDE_BY_ZERO)
/vcl/opengl/program.cxx: 223 in OpenGLProgram::SetTransform(const rtl::OString &, const OpenGLTexture &, const basegfx::B2DPoint &, const basegfx::B2DPoint &, const basegfx::B2DPoint &)()
217         const basegfx::B2DPoint& rX,
218         const basegfx::B2DPoint& rY )
219     {
220         GLuint nUniform = GetUniformLocation( rName );
221         const basegfx::B2DVector aXRel = rX - rNull;
222         const basegfx::B2DVector aYRel = rY - rNull;
>>>     CID 1256664:  Division or modulo by float zero  (DIVIDE_BY_ZERO)
>>>     In expression "(float)aXRel.getY() / rTexture->GetWidth()", division by expression "rTexture->GetWidth()" which may be zero has undefined behavior.
223         const float aValues[] = {
224             (float) aXRel.getX()/rTexture.GetWidth(),  (float) aXRel.getY()/rTexture.GetWidth(),  0, 0,
225             (float) aYRel.getX()/rTexture.GetHeight(), (float) aYRel.getY()/rTexture.GetHeight(), 0, 0,
226             0,                                         0,                                         1, 0,
227             (float) rNull.getX(),                      (float) rNull.getY(),                      0, 1 };
228         glm::mat4 mMatrix = glm::make_mat4( aValues );
/vcl/opengl/program.cxx: 223 in OpenGLProgram::SetTransform(const rtl::OString &, const OpenGLTexture &, const basegfx::B2DPoint &, const basegfx::B2DPoint &, const basegfx::B2DPoint &)()
217         const basegfx::B2DPoint& rX,
218         const basegfx::B2DPoint& rY )
219     {
220         GLuint nUniform = GetUniformLocation( rName );
221         const basegfx::B2DVector aXRel = rX - rNull;
222         const basegfx::B2DVector aYRel = rY - rNull;
>>>     CID 1256664:  Division or modulo by float zero  (DIVIDE_BY_ZERO)
>>>     In expression "(float)aXRel.getX() / rTexture->GetWidth()", division by expression "rTexture->GetWidth()" which may be zero has undefined behavior.
223         const float aValues[] = {
224             (float) aXRel.getX()/rTexture.GetWidth(),  (float) aXRel.getY()/rTexture.GetWidth(),  0, 0,
225             (float) aYRel.getX()/rTexture.GetHeight(), (float) aYRel.getY()/rTexture.GetHeight(), 0, 0,
226             0,                                         0,                                         1, 0,
227             (float) rNull.getX(),                      (float) rNull.getY(),                      0, 1 };
228         glm::mat4 mMatrix = glm::make_mat4( aValues );

________________________________________________________________________________________________________
*** CID 1256669:  Uninitialized pointer field  (UNINIT_CTOR)
/sw/inc/ring.hxx: 62 in sw::Ring<SwViewShell>::Ring()()
56             /**
57              * Creates a new item in a ring container all by itself.
58              * Note: Ring instances can newer be outside a container. At most, they
59              * are alone in one.
60              */
61             Ring()
>>>     CID 1256669:  Uninitialized pointer field  (UNINIT_CTOR)
>>>     Non-static class member "pPrev" is not initialized in this constructor nor in any functions that it calls.
62                 { algo::init_header(static_cast< T* >(this)); }
63             /**
64              * Creates a new item and add it to an existing ring container.
65              * Note: the newly created item will be inserted just before item pRing.
66              * @param pRing ring container to add the created item to
67              */
/sw/inc/ring.hxx: 62 in sw::Ring<<unnamed>::TestRing>::Ring()()
56             /**
57              * Creates a new item in a ring container all by itself.
58              * Note: Ring instances can newer be outside a container. At most, they
59              * are alone in one.
60              */
61             Ring()
>>>     CID 1256669:  Uninitialized pointer field  (UNINIT_CTOR)
>>>     Non-static class member "pPrev" is not initialized in this constructor nor in any functions that it calls.
62                 { algo::init_header(static_cast< T* >(this)); }
63             /**
64              * Creates a new item and add it to an existing ring container.
65              * Note: the newly created item will be inserted just before item pRing.
66              * @param pRing ring container to add the created item to
67              */

________________________________________________________________________________________________________
*** CID 1256668:  Uninitialized pointer field  (UNINIT_CTOR)
/sw/inc/ring.hxx: 112 in sw::Ring<SwPaM>::Ring(SwPaM *)()
106         {
107             T* pThis = static_cast< T* >(this);
108             if( !pObj )
109                 algo::init_header(pThis);
110             else
111                 algo::link_before(pObj, pThis);
>>>     CID 1256668:  Uninitialized pointer field  (UNINIT_CTOR)
>>>     Non-static class member "pPrev" is not initialized in this constructor nor in any functions that it calls.
112         }
113     
114         template <class T>
115         inline void Ring<T>::MoveTo(T* pDestRing)
116         {
117             T* pThis = static_cast< T* >(this);
/sw/inc/ring.hxx: 112 in sw::Ring<_SaveMergeRedlines>::Ring(_SaveMergeRedlines *)()
106         {
107             T* pThis = static_cast< T* >(this);
108             if( !pObj )
109                 algo::init_header(pThis);
110             else
111                 algo::link_before(pObj, pThis);
>>>     CID 1256668:  Uninitialized pointer field  (UNINIT_CTOR)
>>>     Non-static class member "pPrev" is not initialized in this constructor nor in any functions that it calls.
112         }
113     
114         template <class T>
115         inline void Ring<T>::MoveTo(T* pDestRing)
116         {
117             T* pThis = static_cast< T* >(this);
/sw/inc/ring.hxx: 112 in sw::Ring<SwViewShell>::Ring(SwViewShell *)()
106         {
107             T* pThis = static_cast< T* >(this);
108             if( !pObj )
109                 algo::init_header(pThis);
110             else
111                 algo::link_before(pObj, pThis);
>>>     CID 1256668:  Uninitialized pointer field  (UNINIT_CTOR)
>>>     Non-static class member "pPrev" is not initialized in this constructor nor in any functions that it calls.
112         }
113     
114         template <class T>
115         inline void Ring<T>::MoveTo(T* pDestRing)
116         {
117             T* pThis = static_cast< T* >(this);


________________________________________________________________________________________________________
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