New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Fri Dec 15 23:03:32 UTC 2017


Hi,

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

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


** CID 1426171:    (FORWARD_NULL)
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1916 in SwTiledRenderingTest::testDocumentRepair()()
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1917 in SwTiledRenderingTest::testDocumentRepair()()
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1932 in SwTiledRenderingTest::testDocumentRepair()()
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1933 in SwTiledRenderingTest::testDocumentRepair()()


________________________________________________________________________________________________________
*** CID 1426171:    (FORWARD_NULL)
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1916 in SwTiledRenderingTest::testDocumentRepair()()
1910             std::unique_ptr<SfxPoolItem> pItem1;
1911             std::unique_ptr<SfxPoolItem> pItem2;
1912             pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
1913             pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
1914             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem1.get()));
1915             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem2.get()));
>>>     CID 1426171:    (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem1.get())" can return "NULL".
1916             CPPUNIT_ASSERT_EQUAL(false, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
1917             CPPUNIT_ASSERT_EQUAL(false, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
1918         }
1919     
1920         // Insert a character in the second view.
1921         SfxLokHelper::setView(nView2);
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1917 in SwTiledRenderingTest::testDocumentRepair()()
1911             std::unique_ptr<SfxPoolItem> pItem2;
1912             pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
1913             pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
1914             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem1.get()));
1915             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem2.get()));
1916             CPPUNIT_ASSERT_EQUAL(false, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
>>>     CID 1426171:    (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem2.get())" can return "NULL".
1917             CPPUNIT_ASSERT_EQUAL(false, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
1918         }
1919     
1920         // Insert a character in the second view.
1921         SfxLokHelper::setView(nView2);
1922         pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'u', 0);
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1932 in SwTiledRenderingTest::testDocumentRepair()()
1926             std::unique_ptr<SfxPoolItem> pItem1;
1927             std::unique_ptr<SfxPoolItem> pItem2;
1928             pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
1929             pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
1930             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem1.get()));
1931             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem2.get()));
>>>     CID 1426171:    (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem1.get())" can return "NULL".
1932             CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
1933             CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
1934         }
1935     
1936         comphelper::LibreOfficeKit::setActive(false);
1937     }
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1933 in SwTiledRenderingTest::testDocumentRepair()()
1927             std::unique_ptr<SfxPoolItem> pItem2;
1928             pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
1929             pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
1930             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem1.get()));
1931             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem2.get()));
1932             CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
>>>     CID 1426171:    (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem2.get())" can return "NULL".
1933             CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
1934         }
1935     
1936         comphelper::LibreOfficeKit::setActive(false);
1937     }
1938     

** CID 1426170:    (FORWARD_NULL)
/sc/qa/unit/tiledrendering/tiledrendering.cxx: 1449 in <unnamed>::ScTiledRenderingTest::testDocumentRepair()()
/sc/qa/unit/tiledrendering/tiledrendering.cxx: 1450 in <unnamed>::ScTiledRenderingTest::testDocumentRepair()()
/sc/qa/unit/tiledrendering/tiledrendering.cxx: 1468 in <unnamed>::ScTiledRenderingTest::testDocumentRepair()()
/sc/qa/unit/tiledrendering/tiledrendering.cxx: 1469 in <unnamed>::ScTiledRenderingTest::testDocumentRepair()()


________________________________________________________________________________________________________
*** CID 1426170:    (FORWARD_NULL)
/sc/qa/unit/tiledrendering/tiledrendering.cxx: 1449 in <unnamed>::ScTiledRenderingTest::testDocumentRepair()()
1443             std::unique_ptr<SfxPoolItem> pItem1;
1444             std::unique_ptr<SfxPoolItem> pItem2;
1445             pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
1446             pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
1447             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem1.get()));
1448             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem2.get()));
>>>     CID 1426170:    (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem1.get())" can return "NULL".
1449             CPPUNIT_ASSERT_EQUAL(false, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
1450             CPPUNIT_ASSERT_EQUAL(false, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
1451         }
1452     
1453         // Insert a character in the second view.
1454         SfxLokHelper::setView(nView2);
/sc/qa/unit/tiledrendering/tiledrendering.cxx: 1450 in <unnamed>::ScTiledRenderingTest::testDocumentRepair()()
1444             std::unique_ptr<SfxPoolItem> pItem2;
1445             pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
1446             pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
1447             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem1.get()));
1448             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem2.get()));
1449             CPPUNIT_ASSERT_EQUAL(false, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
>>>     CID 1426170:    (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem2.get())" can return "NULL".
1450             CPPUNIT_ASSERT_EQUAL(false, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
1451         }
1452     
1453         // Insert a character in the second view.
1454         SfxLokHelper::setView(nView2);
1455         pModelObj->setPart(1);
/sc/qa/unit/tiledrendering/tiledrendering.cxx: 1468 in <unnamed>::ScTiledRenderingTest::testDocumentRepair()()
1462             std::unique_ptr<SfxPoolItem> pItem1;
1463             std::unique_ptr<SfxPoolItem> pItem2;
1464             pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
1465             pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
1466             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem1.get()));
1467             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem2.get()));
>>>     CID 1426170:    (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem1.get())" can return "NULL".
1468             CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
1469             CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
1470         }
1471     
1472         comphelper::LibreOfficeKit::setActive(false);
1473     }
/sc/qa/unit/tiledrendering/tiledrendering.cxx: 1469 in <unnamed>::ScTiledRenderingTest::testDocumentRepair()()
1463             std::unique_ptr<SfxPoolItem> pItem2;
1464             pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
1465             pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
1466             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem1.get()));
1467             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem2.get()));
1468             CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
>>>     CID 1426170:    (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem2.get())" can return "NULL".
1469             CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
1470         }
1471     
1472         comphelper::LibreOfficeKit::setActive(false);
1473     }
1474     

** CID 1426169:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/layout/flycnt.cxx: 80 in SwFlyAtContentFrame::Modify(const SfxPoolItem *, const SfxPoolItem *)()


________________________________________________________________________________________________________
*** CID 1426169:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/layout/flycnt.cxx: 80 in SwFlyAtContentFrame::Modify(const SfxPoolItem *, const SfxPoolItem *)()
74     }
75     
76     // #i28701#
77     
78     void SwFlyAtContentFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
79     {
>>>     CID 1426169:  Null pointer dereferences  (FORWARD_NULL)
>>>     Comparing "pNew" to null implies that "pNew" might be null.
80         const sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
81         const SwFormatAnchor *pAnch = nullptr;
82     
83         if( RES_ATTRSET_CHG == nWhich && SfxItemState::SET ==
84             static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_ANCHOR, false,
85                 reinterpret_cast<const SfxPoolItem**>(&pAnch) ))

** CID 1426168:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/layout/fly.cxx: 765 in SwFlyFrame::UpdateAttr_(const SfxPoolItem *, const SfxPoolItem *, unsigned char &, SwAttrSetChg *, SwAttrSetChg *)()


________________________________________________________________________________________________________
*** CID 1426168:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/layout/fly.cxx: 765 in SwFlyFrame::UpdateAttr_(const SfxPoolItem *, const SfxPoolItem *, unsigned char &, SwAttrSetChg *, SwAttrSetChg *)()
759                     NotifyDrawObj();
760                 rInvFlags |= 0x7F;
761                 if ( RES_FMT_CHG == nWhich )
762                 {
763                     SwRect aNew( GetObjRectWithSpaces() );
764                     SwRect aOld( getFrameArea() );
>>>     CID 1426168:  Null pointer dereferences  (FORWARD_NULL)
>>>     Dereferencing null pointer "pOld".
765                     const SvxULSpaceItem &rUL = static_cast<const SwFormatChg*>(pOld)->pChangedFormat->GetULSpace();
766                     aOld.Top( std::max( aOld.Top() - long(rUL.GetUpper()), 0L ) );
767                     aOld.SSize().Height()+= rUL.GetLower();
768                     const SvxLRSpaceItem &rLR = static_cast<const SwFormatChg*>(pOld)->pChangedFormat->GetLRSpace();
769                     aOld.Left  ( std::max( aOld.Left() - rLR.GetLeft(), 0L ) );
770                     aOld.SSize().Width() += rLR.GetRight();

** CID 1426167:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/layout/atrfrm.cxx: 2552 in SwFrameFormat::Modify(const SfxPoolItem *, const SfxPoolItem *)()


________________________________________________________________________________________________________
*** CID 1426167:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/layout/atrfrm.cxx: 2552 in SwFrameFormat::Modify(const SfxPoolItem *, const SfxPoolItem *)()
2546     
2547     void SwFrameFormat::Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew )
2548     {
2549         SwFormatHeader const *pH = nullptr;
2550         SwFormatFooter const *pF = nullptr;
2551     
>>>     CID 1426167:  Null pointer dereferences  (FORWARD_NULL)
>>>     Comparing "pNew" to null implies that "pNew" might be null.
2552         const sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
2553     
2554         if( RES_ATTRSET_CHG == nWhich )
2555         {
2556             static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState(
2557                 RES_HEADER, false, reinterpret_cast<const SfxPoolItem**>(&pH) );

** CID 1426166:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/layout/flylay.cxx: 716 in SwFlyLayFrame::Modify(const SfxPoolItem *, const SfxPoolItem *)()


________________________________________________________________________________________________________
*** CID 1426166:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/layout/flylay.cxx: 716 in SwFlyLayFrame::Modify(const SfxPoolItem *, const SfxPoolItem *)()
710     }
711     
712     // #i28701#
713     
714     void SwFlyLayFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *pNew )
715     {
>>>     CID 1426166:  Null pointer dereferences  (FORWARD_NULL)
>>>     Comparing "pNew" to null implies that "pNew" might be null.
716         const sal_uInt16 nWhich = pNew ? pNew->Which() : 0;
717     
718         const SwFormatAnchor *pAnch = nullptr;
719         if( RES_ATTRSET_CHG == nWhich && SfxItemState::SET ==
720             static_cast<const SwAttrSetChg*>(pNew)->GetChgSet()->GetItemState( RES_ANCHOR, false,
721                 reinterpret_cast<const SfxPoolItem**>(&pAnch) ))

** CID 1426165:  Null pointer dereferences  (FORWARD_NULL)
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1946 in <unnamed>::checkPageHeaderOrFooter(const SfxViewShell *, unsigned short, bool)()


________________________________________________________________________________________________________
*** CID 1426165:  Null pointer dereferences  (FORWARD_NULL)
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1946 in <unnamed>::checkPageHeaderOrFooter(const SfxViewShell *, unsigned short, bool)()
1940     
1941     void checkPageHeaderOrFooter(const SfxViewShell* pViewShell, sal_uInt16 nWhich, bool bValue)
1942     {
1943         const SfxPoolItem* pState = nullptr;
1944         pViewShell->GetDispatcher()->QueryState(nWhich, pState);
1945         CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem * >(pState));
>>>     CID 1426165:  Null pointer dereferences  (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pState)" can return "NULL".
1946         CPPUNIT_ASSERT_EQUAL(bValue, dynamic_cast< const SfxBoolItem * >(pState)->GetValue());
1947     };
1948     
1949     }
1950     
1951     void SwTiledRenderingTest::testPageHeader()

** CID 1426164:    (FORWARD_NULL)
/sd/qa/unit/tiledrendering/tiledrendering.cxx: 1871 in SdTiledRenderingTest::testDocumentRepair()()
/sd/qa/unit/tiledrendering/tiledrendering.cxx: 1872 in SdTiledRenderingTest::testDocumentRepair()()
/sd/qa/unit/tiledrendering/tiledrendering.cxx: 1890 in SdTiledRenderingTest::testDocumentRepair()()
/sd/qa/unit/tiledrendering/tiledrendering.cxx: 1891 in SdTiledRenderingTest::testDocumentRepair()()


________________________________________________________________________________________________________
*** CID 1426164:    (FORWARD_NULL)
/sd/qa/unit/tiledrendering/tiledrendering.cxx: 1871 in SdTiledRenderingTest::testDocumentRepair()()
1865             std::unique_ptr<SfxPoolItem> pItem1;
1866             std::unique_ptr<SfxPoolItem> pItem2;
1867             pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
1868             pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
1869             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem1.get()));
1870             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem2.get()));
>>>     CID 1426164:    (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem1.get())" can return "NULL".
1871             CPPUNIT_ASSERT_EQUAL(false, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
1872             CPPUNIT_ASSERT_EQUAL(false, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
1873         }
1874     
1875         // Insert a character in the second view.
1876         SfxLokHelper::setView(nView2);
/sd/qa/unit/tiledrendering/tiledrendering.cxx: 1872 in SdTiledRenderingTest::testDocumentRepair()()
1866             std::unique_ptr<SfxPoolItem> pItem2;
1867             pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
1868             pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
1869             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem1.get()));
1870             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem2.get()));
1871             CPPUNIT_ASSERT_EQUAL(false, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
>>>     CID 1426164:    (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem2.get())" can return "NULL".
1872             CPPUNIT_ASSERT_EQUAL(false, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
1873         }
1874     
1875         // Insert a character in the second view.
1876         SfxLokHelper::setView(nView2);
1877         pXImpressDocument->setPart(1);
/sd/qa/unit/tiledrendering/tiledrendering.cxx: 1890 in SdTiledRenderingTest::testDocumentRepair()()
1884             std::unique_ptr<SfxPoolItem> pItem1;
1885             std::unique_ptr<SfxPoolItem> pItem2;
1886             pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
1887             pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
1888             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem1.get()));
1889             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem2.get()));
>>>     CID 1426164:    (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem1.get())" can return "NULL".
1890             CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
1891             CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
1892         }
1893     
1894         comphelper::LibreOfficeKit::setActive(false);
1895     }
/sd/qa/unit/tiledrendering/tiledrendering.cxx: 1891 in SdTiledRenderingTest::testDocumentRepair()()
1885             std::unique_ptr<SfxPoolItem> pItem2;
1886             pView1->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem1);
1887             pView2->GetViewFrame()->GetBindings().QueryState(SID_DOC_REPAIR, pItem2);
1888             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem1.get()));
1889             CPPUNIT_ASSERT(dynamic_cast< const SfxBoolItem* >(pItem2.get()));
1890             CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem1.get())->GetValue());
>>>     CID 1426164:    (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem2.get())" can return "NULL".
1891             CPPUNIT_ASSERT_EQUAL(true, dynamic_cast< const SfxBoolItem* >(pItem2.get())->GetValue());
1892         }
1893     
1894         comphelper::LibreOfficeKit::setActive(false);
1895     }
1896     

** CID 1426163:    (NEGATIVE_RETURNS)


________________________________________________________________________________________________________
*** CID 1426163:    (NEGATIVE_RETURNS)
/svx/source/unogallery/unogalitem.cxx: 275 in unogallery::GalleryItem::_getPropertyValues(const comphelper::PropertyMapEntry **, com::sun::star::uno::Any *)()
269                 case UNOGALLERY_TITLE:
270                 {
271                     ::GalleryTheme* pGalTheme = ( isValid() ? mpTheme->implGetTheme() : nullptr );
272     
273                     if( pGalTheme )
274                     {
>>>     CID 1426163:    (NEGATIVE_RETURNS)
>>>     "pGalTheme->ImplGetGalleryObjectPos(this->implGetObject())" is passed to a parameter that cannot be negative.
275                         SgaObject* pObj = pGalTheme->AcquireObject( pGalTheme->ImplGetGalleryObjectPos( implGetObject() ) );
276     
277                         if( pObj )
278                         {
279                             *pValue <<= pObj->GetTitle();
280                             ::GalleryTheme::ReleaseObject( pObj );
/svx/source/unogallery/unogalitem.cxx: 292 in unogallery::GalleryItem::_getPropertyValues(const comphelper::PropertyMapEntry **, com::sun::star::uno::Any *)()
286                 case UNOGALLERY_THUMBNAIL:
287                 {
288                     ::GalleryTheme* pGalTheme = ( isValid() ? mpTheme->implGetTheme() : nullptr );
289     
290                     if( pGalTheme )
291                     {
>>>     CID 1426163:    (NEGATIVE_RETURNS)
>>>     "pGalTheme->ImplGetGalleryObjectPos(this->implGetObject())" is passed to a parameter that cannot be negative.
292                         SgaObject* pObj = pGalTheme->AcquireObject( pGalTheme->ImplGetGalleryObjectPos( implGetObject() ) );
293     
294                         if( pObj )
295                         {
296                             Graphic aThumbnail;
297     
/svx/source/unogallery/unogalitem.cxx: 315 in unogallery::GalleryItem::_getPropertyValues(const comphelper::PropertyMapEntry **, com::sun::star::uno::Any *)()
309     
310                 case UNOGALLERY_GRAPHIC:
311                 {
312                     ::GalleryTheme* pGalTheme = ( isValid() ? mpTheme->implGetTheme() : nullptr );
313                     Graphic         aGraphic;
314     
>>>     CID 1426163:    (NEGATIVE_RETURNS)
>>>     "pGalTheme->ImplGetGalleryObjectPos(this->implGetObject())" is passed to a parameter that cannot be negative.
315                     if( pGalTheme && pGalTheme->GetGraphic( pGalTheme->ImplGetGalleryObjectPos( implGetObject() ), aGraphic ) )
316                         *pValue <<= aGraphic.GetXGraphic();
317                 }
318                 break;
319     
320                 case UNOGALLERY_DRAWING:
/svx/source/unogallery/unogalitem.cxx: 329 in unogallery::GalleryItem::_getPropertyValues(const comphelper::PropertyMapEntry **, com::sun::star::uno::Any *)()
323                     {
324                         ::GalleryTheme* pGalTheme = ( isValid() ? mpTheme->implGetTheme() : nullptr );
325                         FmFormModel*    pModel = new FmFormModel;
326     
327                         pModel->GetItemPool().FreezeIdRanges();
328     
>>>     CID 1426163:    (NEGATIVE_RETURNS)
>>>     "pGalTheme->ImplGetGalleryObjectPos(this->implGetObject())" is passed to a parameter that cannot be negative.
329                         if( pGalTheme && pGalTheme->GetModel( pGalTheme->ImplGetGalleryObjectPos( implGetObject() ), *pModel ) )
330                         {
331                             uno::Reference< lang::XComponent > xDrawing( new GalleryDrawingModel( pModel ) );
332     
333                             pModel->setUnoModel( uno::Reference< uno::XInterface >::query( xDrawing ) );
334                             *pValue <<= xDrawing;

** CID 1426162:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/txtnode/ndtxt.cxx: 3576 in SwTextNode::Modify(const SfxPoolItem *, const SfxPoolItem *)()


________________________________________________________________________________________________________
*** CID 1426162:  Null pointer dereferences  (FORWARD_NULL)
/sw/source/core/txtnode/ndtxt.cxx: 3576 in SwTextNode::Modify(const SfxPoolItem *, const SfxPoolItem *)()
3570                             static_cast<const SwTextFormatColl*>(static_cast<const SwFormatChg*>(pNewValue)->pChangedFormat) );
3571         }
3572     
3573         // reset fill information
3574         if(maFillAttributes.get())
3575         {
>>>     CID 1426162:  Null pointer dereferences  (FORWARD_NULL)
>>>     Comparing "pNewValue" to null implies that "pNewValue" might be null.
3576             const sal_uInt16 nWhich = pNewValue ? pNewValue->Which() : 0;
3577             bool bReset(RES_FMT_CHG == nWhich); // ..on format change (e.g. style changed)
3578     
3579             if(!bReset && RES_ATTRSET_CHG == nWhich) // ..on ItemChange from DrawingLayer FillAttributes
3580             {
3581                 SfxItemIter aIter(*static_cast<const SwAttrSetChg*>(pNewValue)->GetChgSet());


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZBnDJeNb0HijxaS4JNJPxk3kpyAm2AYqo71yXmnOxB72ibeUH-2F-2F1Lhi9AZq3dRu-2F4-3D_g-2BrHdvqzaBa155F-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpyTQOKKRag0zzyn6Mk3m85ALeVCu-2B1uPpr0Xlv4n-2BMmQMgxBOWyNEdAvtmGfGrkdXq-2FeCnbyR-2FqI7-2BVF5-2BVwRCivHdA-2BdOlwep96VVHEKCMV6e8ZBXeb5a8c0EJdLQq7uK7gLdIYlTds7FlsegdmexOenDFbTQnFJSBzhb7kfd-2FQc-3D

To manage Coverity Scan email notifications for "libreoffice at lists.freedesktop.org", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4k1FZJSDV-2FTHi5VQof9xGafB4oBwGYxuHHknceo2QLpCrZ44Ciy7AqBR2QyX6OCB5lwWgMDuK-2FivqaohkU3M9kT-2Fww10Qt2GoaCJAOQCa0Wv4ijH4oV8jCt0XXa7QeAwh_g-2BrHdvqzaBa155F-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpyTQOKKRag0zzyn6Mk3m85AEAoJomti-2FoTlitafZcM14HEkrDCj43I9KvT-2BighC2rYUlgPQTcfdHufQ0qdMMVzxQsCz9sS7alQVLvHtpDfz3JrbUqa96juj0c-2BsHK-2Bl0z15I6nqfWJJIIIFg2jGPSYwrw7aQk6JyjbPWw0lcJqwkA-3D



More information about the LibreOffice mailing list