New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Sun Apr 30 14:10:00 UTC 2017


Hi,

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

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


** CID 1405740:    (RESOURCE_LEAK)
/vcl/qa/cppunit/errorhandler.cxx: 53 in ErrorHandlerTest::testGetErrorString()()
/vcl/qa/cppunit/errorhandler.cxx: 58 in ErrorHandlerTest::testGetErrorString()()


________________________________________________________________________________________________________
*** CID 1405740:    (RESOURCE_LEAK)
/vcl/qa/cppunit/errorhandler.cxx: 53 in ErrorHandlerTest::testGetErrorString()()
47         MockErrorHandler aErrHdlr;
48         OUString aErrStr;
49     
50         CPPUNIT_ASSERT_MESSAGE("GetErrorString(ERRCODE_ABORT, aErrStr) should return false",
51                                !ErrorHandler::GetErrorString(ERRCODE_ABORT, aErrStr));
52         // normally protected, but MockErrorHandler is a friend of this class
>>>     CID 1405740:    (RESOURCE_LEAK)
>>>     Failing to save or free storage allocated by "ErrorInfo::GetErrorInfo(283U)" leaks it.
53         aErrHdlr.CreateString(ErrorInfo::GetErrorInfo(ERRCODE_ABORT), aErrStr);
54         CPPUNIT_ASSERT_EQUAL_MESSAGE("error message should be non-dynamic", OUString("Non-dynamic error"), aErrStr);
55     
56         CPPUNIT_ASSERT_MESSAGE("GetErrorString(ERRCODE_NONE, aErrStr) should return false",
57                                !ErrorHandler::GetErrorString(ERRCODE_NONE, aErrStr));
58         aErrHdlr.CreateString(ErrorInfo::GetErrorInfo(ERRCODE_NONE), aErrStr);
/vcl/qa/cppunit/errorhandler.cxx: 58 in ErrorHandlerTest::testGetErrorString()()
52         // normally protected, but MockErrorHandler is a friend of this class
53         aErrHdlr.CreateString(ErrorInfo::GetErrorInfo(ERRCODE_ABORT), aErrStr);
54         CPPUNIT_ASSERT_EQUAL_MESSAGE("error message should be non-dynamic", OUString("Non-dynamic error"), aErrStr);
55     
56         CPPUNIT_ASSERT_MESSAGE("GetErrorString(ERRCODE_NONE, aErrStr) should return false",
57                                !ErrorHandler::GetErrorString(ERRCODE_NONE, aErrStr));
>>>     CID 1405740:    (RESOURCE_LEAK)
>>>     Failing to save or free storage allocated by "ErrorInfo::GetErrorInfo(0U)" leaks it.
58         aErrHdlr.CreateString(ErrorInfo::GetErrorInfo(ERRCODE_NONE), aErrStr);
59         CPPUNIT_ASSERT_EQUAL_MESSAGE("error message should be non-dynamic", OUString("Non-dynamic error"), aErrStr);
60     }
61     
62     CPPUNIT_TEST_SUITE_REGISTRATION(ErrorHandlerTest);
63     
64     CPPUNIT_PLUGIN_IMPLEMENT();
65     

** CID 1405739:  Null pointer dereferences  (FORWARD_NULL)
/wizards/com/sun/star/wizards/ui/ButtonList.java: 473 in com.sun.star.wizards.ui.ButtonList.refreshImageText()()


________________________________________________________________________________________________________
*** CID 1405739:  Null pointer dereferences  (FORWARD_NULL)
/wizards/com/sun/star/wizards/ui/ButtonList.java: 473 in com.sun.star.wizards.ui.ButtonList.refreshImageText()()
467     
468         /**
469          * set the text under the button list
470          */
471         private void refreshImageText()
472         {
>>>     CID 1405739:  Null pointer dereferences  (FORWARD_NULL)
>>>     Assigning: "item" = "null".
473             Object item = m_nCurrentSelection >= 0 ? getListModel().getElementAt(m_nCurrentSelection) : null;
474             final String sText = PropertyNames.SPACE + renderer.render(item);
475             Helper.setUnoPropertyValue(getModel(lblImageText), PropertyNames.PROPERTY_LABEL, sText);
476         }
477     
478         public void setShowButtons(boolean b)

** CID 1405738:  Null pointer dereferences  (FORWARD_NULL)
/sfx2/source/control/unoctitm.cxx: 748 in SfxDispatchController_Impl::dispatch(const com::sun::star::util::URL &, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> &, const com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> &)()


________________________________________________________________________________________________________
*** CID 1405738:  Null pointer dereferences  (FORWARD_NULL)
/sfx2/source/control/unoctitm.cxx: 748 in SfxDispatchController_Impl::dispatch(const com::sun::star::util::URL &, const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> &, const com::sun::star::uno::Reference<com::sun::star::frame::XDispatchResultListener> &)()
742                             {
743                                 // execute with arguments - call directly
744                                 pItem = pDispatcher->Execute(GetId(), nCall, xSet.get(), &aInternalSet, nModifier);
745                                 if ( pItem != nullptr )
746                                 {
747                                     if ( dynamic_cast< const SfxBoolItem *>( pItem ) !=  nullptr )
>>>     CID 1405738:  Null pointer dereferences  (FORWARD_NULL)
>>>     Dynamic cast to pointer "dynamic_cast <SfxBoolItem const *>(pItem)" can return "NULL".
748                                         bSuccess = dynamic_cast< const SfxBoolItem *>( pItem )->GetValue();
749                                     else if ( dynamic_cast< const SfxVoidItem *>( pItem ) ==  nullptr )
750                                         bSuccess = true;  // all other types are true
751                                 }
752                                 // else bSuccess = false look to line 664 it is false
753                             }

** CID 1405737:  Control flow issues  (DEADCODE)
/vcl/source/window/errinf.cxx: 142 in ErrorHandler::HandleError(unsigned int, DialogMask)()


________________________________________________________________________________________________________
*** CID 1405737:  Control flow issues  (DEADCODE)
/vcl/source/window/errinf.cxx: 142 in ErrorHandler::HandleError(unsigned int, DialogMask)()
136             }
137         }
138     
139         bool bWarning = ((nErrCodeId & ERRCODE_WARNING_MASK) == ERRCODE_WARNING_MASK);
140         DialogMask nErrFlags = DialogMask::ButtonDefaultsOk | DialogMask::ButtonsOk;
141         if (bWarning)
>>>     CID 1405737:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach this statement: "nErrFlags |= DialogMask::Me...".
142             nErrFlags |= DialogMask::MessageWarning;
143         else
144             nErrFlags |= DialogMask::MessageError;
145     
146         DynamicErrorInfo* pDynPtr = dynamic_cast<DynamicErrorInfo*>(pInfo);
147         if(pDynPtr)


________________________________________________________________________________________________________
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-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpyvgyry0-2F1C5efkCV4FnKnoEOHGXL9aYewpkjdpeoR7qXqQ0kUosOECeBtHVOmbB3a79KBhweIhHXYtBdegvtVvJjJcbMkP5ep3B-2Fxw2urQaU0dxxnhj-2BiNDlM-2FnYzstrlfD4DnXUrK4A79FQvUNorBJ0TzFvyEXWQ-2F6bMHQkeCqk-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-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpyvgyry0-2F1C5efkCV4FnKnoAmUOEn-2BfnIZySR-2BksWFzAghZ-2FHxMxBqzbulSkTRvTqma60r7nPoGJjhoVG87L3ynJ-2FCvsj29LJm7CmELrriRpuvZ5wgq2Vfd3P0utrmIbNSRBLCZ4gs7v-2ByVTIhCruT3harW-2FdM-2BxFxxChddziVZKY-3D



More information about the LibreOffice mailing list