New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Tue May 30 07:15:47 UTC 2017


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 1411569:  Null pointer dereferences  (FORWARD_NULL)
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1790 in SwTiledRenderingTest::testDisableUndoRepair()()


________________________________________________________________________________________________________
*** CID 1411569:  Null pointer dereferences  (FORWARD_NULL)
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1790 in SwTiledRenderingTest::testDisableUndoRepair()()
1784             CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, aItemSet2.GetItemState(SID_UNDO));
1785             CPPUNIT_ASSERT(!dynamic_cast< const SfxUInt32Item * >(aItemSet2.GetItem(SID_UNDO)));
1786             // first view, undo conflict
1787             pView1->GetState(aItemSet1);
1788             CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, aItemSet1.GetItemState(SID_UNDO));
1789             CPPUNIT_ASSERT(dynamic_cast< const SfxUInt32Item * >(aItemSet1.GetItem(SID_UNDO)));
>>>     CID 1411569:  Null pointer dereferences  (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxUInt32Item const *>(aItemSet1.GetItem(5701, true))" can return "NULL".
1790             CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SwUndoId::CONFLICT), dynamic_cast< const SfxUInt32Item * >(aItemSet1.GetItem(SID_UNDO))->GetValue());
1791         }
1792     
1793         // Insert a character in the first view.
1794         SfxLokHelper::setView(nView1);
1795         pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'l', 0);

** CID 1411568:  Null pointer dereferences  (FORWARD_NULL)
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1764 in SwTiledRenderingTest::testDisableUndoRepair()::[lambda() (instance 1)]::operator ()() const()


________________________________________________________________________________________________________
*** CID 1411568:  Null pointer dereferences  (FORWARD_NULL)
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1764 in SwTiledRenderingTest::testDisableUndoRepair()::[lambda() (instance 1)]::operator ()() const()
1758             CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, aItemSet1.GetItemState(SID_UNDO));
1759             CPPUNIT_ASSERT(!dynamic_cast< const SfxUInt32Item * >(aItemSet1.GetItem(SID_UNDO)));
1760             // second view, undo conflict
1761             pView2->GetState(aItemSet2);
1762             CPPUNIT_ASSERT_EQUAL(SfxItemState::SET, aItemSet2.GetItemState(SID_UNDO));
1763             CPPUNIT_ASSERT(dynamic_cast< const SfxUInt32Item * >(aItemSet2.GetItem(SID_UNDO)));
>>>     CID 1411568:  Null pointer dereferences  (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxUInt32Item const *>(aItemSet2.GetItem(5701, true))" can return "NULL".
1764             CPPUNIT_ASSERT_EQUAL(static_cast<sal_uInt32>(SwUndoId::CONFLICT), dynamic_cast< const SfxUInt32Item * >(aItemSet2.GetItem(SID_UNDO))->GetValue());
1765         };
1766     
1767         // Insert a character in the first view.
1768         SfxLokHelper::setView(nView1);
1769         pXTextDocument->postKeyEvent(LOK_KEYEVENT_KEYINPUT, 'k', 0);

** CID 1411567:    (FORWARD_NULL)
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1740 in SwTiledRenderingTest::testDisableUndoRepair()()
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1740 in SwTiledRenderingTest::testDisableUndoRepair()()


________________________________________________________________________________________________________
*** CID 1411567:    (FORWARD_NULL)
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1740 in SwTiledRenderingTest::testDisableUndoRepair()()
1734         SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
1735         ViewCallback aView1;
1736         SwView* pView1 = dynamic_cast<SwView*>(SfxViewShell::Current());
1737         int nView1 = SfxLokHelper::getView();
1738         SfxLokHelper::createView();
1739         ViewCallback aView2;
>>>     CID 1411567:    (FORWARD_NULL)
>>>     Assigning: "pView2" = "dynamic_cast <SwView *>(SfxViewShell::Current())".
1740         SwView* pView2 = dynamic_cast<SwView*>(SfxViewShell::Current());
1741         int nView2 = SfxLokHelper::getView();
1742     
1743         {
1744             SfxItemSet aItemSet1(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), SID_UNDO, SID_UNDO);
1745             SfxItemSet aItemSet2(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), SID_UNDO, SID_UNDO);
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1740 in SwTiledRenderingTest::testDisableUndoRepair()()
1734         SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
1735         ViewCallback aView1;
1736         SwView* pView1 = dynamic_cast<SwView*>(SfxViewShell::Current());
1737         int nView1 = SfxLokHelper::getView();
1738         SfxLokHelper::createView();
1739         ViewCallback aView2;
>>>     CID 1411567:    (FORWARD_NULL)
>>>     Assigning: "pView2" = "dynamic_cast <SwView *>(SfxViewShell::Current())".
1740         SwView* pView2 = dynamic_cast<SwView*>(SfxViewShell::Current());
1741         int nView2 = SfxLokHelper::getView();
1742     
1743         {
1744             SfxItemSet aItemSet1(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), SID_UNDO, SID_UNDO);
1745             SfxItemSet aItemSet2(pXTextDocument->GetDocShell()->GetDoc()->GetAttrPool(), SID_UNDO, SID_UNDO);

** CID 1411566:    (FORWARD_NULL)
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1736 in SwTiledRenderingTest::testDisableUndoRepair()()
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1736 in SwTiledRenderingTest::testDisableUndoRepair()()


________________________________________________________________________________________________________
*** CID 1411566:    (FORWARD_NULL)
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1736 in SwTiledRenderingTest::testDisableUndoRepair()()
1730     {
1731         comphelper::LibreOfficeKit::setActive();
1732     
1733         // Create two views.
1734         SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
1735         ViewCallback aView1;
>>>     CID 1411566:    (FORWARD_NULL)
>>>     Assigning: "pView1" = "dynamic_cast <SwView *>(SfxViewShell::Current())".
1736         SwView* pView1 = dynamic_cast<SwView*>(SfxViewShell::Current());
1737         int nView1 = SfxLokHelper::getView();
1738         SfxLokHelper::createView();
1739         ViewCallback aView2;
1740         SwView* pView2 = dynamic_cast<SwView*>(SfxViewShell::Current());
1741         int nView2 = SfxLokHelper::getView();
/sw/qa/extras/tiledrendering/tiledrendering.cxx: 1736 in SwTiledRenderingTest::testDisableUndoRepair()()
1730     {
1731         comphelper::LibreOfficeKit::setActive();
1732     
1733         // Create two views.
1734         SwXTextDocument* pXTextDocument = createDoc("dummy.fodt");
1735         ViewCallback aView1;
>>>     CID 1411566:    (FORWARD_NULL)
>>>     Assigning: "pView1" = "dynamic_cast <SwView *>(SfxViewShell::Current())".
1736         SwView* pView1 = dynamic_cast<SwView*>(SfxViewShell::Current());
1737         int nView1 = SfxLokHelper::getView();
1738         SfxLokHelper::createView();
1739         ViewCallback aView2;
1740         SwView* pView2 = dynamic_cast<SwView*>(SfxViewShell::Current());
1741         int nView2 = SfxLokHelper::getView();

** CID 1411565:  Possible Control flow issues  (DEADCODE)
/i18nutil/source/utility/paper.cxx: 285 in PaperInfo::getSystemDefaultPaper()()


________________________________________________________________________________________________________
*** CID 1411565:  Possible Control flow issues  (DEADCODE)
/i18nutil/source/utility/paper.cxx: 285 in PaperInfo::getSystemDefaultPaper()()
279                     }
280     
281                     if (ePaper != PAPER_USER)
282                     {
283                         aInstance = PaperInfo(ePaper);
284                         if (bHalve)
>>>     CID 1411565:  Possible Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "aInstance = PaperInfo(aInst...".
285                             aInstance = PaperInfo(aInstance.getHeight()/2, aInstance.getWidth());
286                         bInitialized = true;
287                         return aInstance;
288                     }
289                 }
290             }


________________________________________________________________________________________________________
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-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpyy3N6HxJpn2skE5KEk2-2BpiIHHx89Wr35e7o1QhjR5L9mVWaAYpcV5W3R5X0aAUkpTSc9AxdW0KBb8dw1Y8-2FDMRLpwxUl1NbJtXamj0fDEzdeqpDmyR5fWDffyi25jLaQsJunEHaymCukfTPg6K0bLrCG0eTMXMMw44zYarlI9lhU-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-2FTHi5VQof9xGafB4oBwGYxuHHknceo2QLpCrZ44Ciy7AqBR2QyX6OCB5N5X-2B1MAElavPQhH6nLwozJzqOkt2k8uOkYf2ZoppNa9QVe0T3fEZVQ7Kky1tOkLz_g-2BrHdvqzaBa155F-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpyy3N6HxJpn2skE5KEk2-2BpiLJGD2nA2RoMv09Gqfmci739h-2FI1JvpZlbb9Uu2Og9soikBRlRyRPPZ46R2RFuEXdUlQ1BVr5puGdiz-2BrbIjJW-2FoYDgm8djzToh6FbBbYlpO55pwzdmNz-2B8GN9jZUTOcOZEzMuqzaPPB64p3sTd-2BBEs-3D



More information about the LibreOffice mailing list