New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Wed Oct 21 15:01:00 PDT 2015


Hi,

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

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


** CID 1328490:  FindBugs: Correctness  (FB.UWF_NULL_FIELD)
/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java: 95 in ()


________________________________________________________________________________________________________
*** CID 1328490:  FindBugs: Correctness  (FB.UWF_NULL_FIELD)
/qadevOOo/tests/java/mod/_dbaccess/ORowSet.java: 95 in ()
89      * @see com.sun.star.sdbc.XColumnLocate
90      * @see com.sun.star.sdbc.XRowSet
91      * @see com.sun.star.sdb.RowSet
92      * @see com.sun.star.sdbc.XRowUpdate
93      * @see com.sun.star.sdb.XRowSetApproveBroadcaster
94      * @see com.sun.star.beans.XPropertySet
>>>     CID 1328490:  FindBugs: Correctness  (FB.UWF_NULL_FIELD)
>>>     Field only ever set to null: util.DBTools$DataSourceInfo.Name.
95      * @see com.sun.star.sdbc.XRow
96      * @see com.sun.star.sdbc.XWarningsSupplier
97      * @see com.sun.star.lang.XComponent
98      * @see com.sun.star.sdbcx.ResultSet
99      * @see com.sun.star.sdbc.ResultSet
100      * @see ifc.sdbc._RowSet

** CID 1328489:  FindBugs: Performance  (FB.SIC_INNER_SHOULD_BE_STATIC)
/qadevOOo/tests/java/ifc/form/_XConfirmDeleteBroadcaster.java: 47 in ()


________________________________________________________________________________________________________
*** CID 1328489:  FindBugs: Performance  (FB.SIC_INNER_SHOULD_BE_STATIC)
/qadevOOo/tests/java/ifc/form/_XConfirmDeleteBroadcaster.java: 47 in ()
41     */
42     public class _XConfirmDeleteBroadcaster extends MultiMethodTest {
43         public XConfirmDeleteBroadcaster oObj = null;
44         protected XConfirmDeleteListener mxConfirmDeleteListener =
45                                                     new ConfirmDeleteImpl();
46     
>>>     CID 1328489:  FindBugs: Performance  (FB.SIC_INNER_SHOULD_BE_STATIC)
>>>     Should ifc.form._XConfirmDeleteBroadcaster$ConfirmDeleteImpl be a _static_ inner class?
47         private class ConfirmDeleteImpl implements XConfirmDeleteListener {
48             public boolean confirmDelete(RowChangeEvent rowChangeEvent) {
49                 return true;
50             }
51             public void disposing(EventObject eventObject) {
52             }

** CID 1328488:  FindBugs: Dodgy code  (FB.DLS_DEAD_LOCAL_STORE)
/bean/com/sun/star/comp/beans/LocalOfficeWindow.java: 97 in com.sun.star.comp.beans.LocalOfficeWindow.queryAWTToolkit()()


________________________________________________________________________________________________________
*** CID 1328488:  FindBugs: Dodgy code  (FB.DLS_DEAD_LOCAL_STORE)
/bean/com/sun/star/comp/beans/LocalOfficeWindow.java: 97 in com.sun.star.comp.beans.LocalOfficeWindow.queryAWTToolkit()()
91         /**
92          * Returns an AWT toolkit.
93          */
94         private XToolkit queryAWTToolkit() throws com.sun.star.uno.Exception
95         {
96              // Create a UNO toolkit.
>>>     CID 1328488:  FindBugs: Dodgy code  (FB.DLS_DEAD_LOCAL_STORE)
>>>     Dead store to xContext.
97              XComponentContext xContext = mConnection.getComponentContext();
98              XMultiComponentFactory compfactory = mConnection.getComponentContext().getServiceManager();
99              XMultiServiceFactory factory = UnoRuntime.queryInterface(
100                      XMultiServiceFactory.class, compfactory);
101              Object object  = factory.createInstance( "com.sun.star.awt.Toolkit");
102              return UnoRuntime.queryInterface(XToolkit.class, object);

** CID 1328487:  API usage errors  (STREAM_FORMAT_STATE)
/basebmp/test/basictest.cxx: 49 in basebmp::operator <<<char, std::char_traits<char>>(std::basic_ostream<T1, T2> &, const basebmp::Color &)()


________________________________________________________________________________________________________
*** CID 1328487:  API usage errors  (STREAM_FORMAT_STATE)
/basebmp/test/basictest.cxx: 49 in basebmp::operator <<<char, std::char_traits<char>>(std::basic_ostream<T1, T2> &, const basebmp::Color &)()
43     
44     template<typename charT, typename traits>
45     std::basic_ostream<charT, traits> & operator <<(
46         std::basic_ostream<charT, traits> & stream, Color const & value)
47     {
48         auto f = stream.flags();
>>>     CID 1328487:  API usage errors  (STREAM_FORMAT_STATE)
>>>     Changing format state of stream "stream" for categories uppercase, basefield, fill without later restoring it.
49         return stream
50             << std::hex << std::uppercase << std::setw(8) << std::setfill('0')
51             << value.toInt32() << std::setiosflags(f);
52     }
53     
54     template<typename charT, typename traits>

** CID 1328486:  Integer handling issues  (BAD_SHIFT)
/basebmp/inc/metafunctions.hxx: 218 in basebmp::shiftRight<unsigned short>(T1, int)()


________________________________________________________________________________________________________
*** CID 1328486:  Integer handling issues  (BAD_SHIFT)
/basebmp/inc/metafunctions.hxx: 218 in basebmp::shiftRight<unsigned short>(T1, int)()
212         // Avoid undefined behavior and only shift by less than the length in bits
213         // of the promoted left operand:
214         static_assert(
215             std::is_unsigned<T>::value,
216             "must be unsigned for promotedBits and the below ': 0' to be correct");
217         auto const promotedBits = std::numeric_limits<decltype(+T())>::digits;
>>>     CID 1328486:  Integer handling issues  (BAD_SHIFT)
>>>     In expression "v >> shift", right shifting "v" by more than 15 bits always yields zero.  The shift amount, "shift", is as much as 30.
218         return shift >= 0
219             ? shift < promotedBits ? v >> shift : 0
220             : -shift < promotedBits ? v << (-shift) : 0;
221     }
222     
223     } // namespace basebmp
224     
225     #endif /* INCLUDED_BASEBMP_INC_METAFUNCTIONS_HXX */
226     

** CID 441226:  Null pointer dereferences  (NULL_RETURNS)
/sfx2/source/appl/appbas.cxx: 155 in SfxApplication::PropExec_Impl(SfxRequest &)()


________________________________________________________________________________________________________
*** CID 441226:  Null pointer dereferences  (NULL_RETURNS)
/sfx2/source/appl/appbas.cxx: 155 in SfxApplication::PropExec_Impl(SfxRequest &)()
149     {
150         sal_uInt16 nSID = rReq.GetSlot();
151         switch ( nSID )
152         {
153             case SID_ATTR_UNDO_COUNT:
154             {
>>>     CID 441226:  Null pointer dereferences  (NULL_RETURNS)
>>>     Assigning: "pCountItem" = null return value from "GetArg".
155                 const SfxUInt16Item* pCountItem = rReq.GetArg<SfxUInt16Item>(nSID);
156                 std::shared_ptr< comphelper::ConfigurationChanges > batch(
157                     comphelper::ConfigurationChanges::create());
158                 officecfg::Office::Common::Undo::Steps::set(
159                     pCountItem->GetValue(), batch);
160                 batch->commit();


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/libreoffice?tab=overview

To manage Coverity Scan email notifications for "libreoffice at lists.freedesktop.org", click https://scan.coverity.com/subscriptions/edit?email=libreoffice%40lists.freedesktop.org&token=d6481d718a775246b2340f282ebe5939



More information about the LibreOffice mailing list