New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Thu Sep 5 07:22:01 UTC 2019


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.
3 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 1453562:  Error handling issues  (CHECKED_RETURN)
/dbaccess/source/ui/misc/WCopyTable.cxx: 1217 in dbaui::OCopyTableWizard::createTable()()


________________________________________________________________________________________________________
*** CID 1453562:  Error handling issues  (CHECKED_RETURN)
/dbaccess/source/ui/misc/WCopyTable.cxx: 1217 in dbaui::OCopyTableWizard::createTable()()
1211                 sSchema = xMetaData->getUserName();
1212                 // In case of mysql it is not that simple
1213                 if(xMetaData->getDatabaseProductName() == "MySQL")
1214                 {
1215                     Reference< XStatement > xSelect = m_xDestConnection->createStatement();
1216                     Reference< XResultSet > xRs = xSelect->executeQuery("select database()");
>>>     CID 1453562:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "next" without checking return value (as is done elsewhere 185 out of 193 times).
1217                     xRs->next(); // first and only result
1218                     Reference< XRow > xRow( xRs, UNO_QUERY_THROW );
1219                     sSchema = xRow->getString(1);
1220                 }
1221             }
1222     

** CID 1453561:  Null pointer dereferences  (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 1453561:  Null pointer dereferences  (FORWARD_NULL)
/svx/source/svdraw/svdmrkv.cxx: 830 in SdrMarkView::SetMarkHandles(SfxViewShell *)()
824                 bool bTableSelection = false;
825                 bool bCellsAreSelected = false;
826     
827                 if (mpMarkedObj && mpMarkedObj->GetObjIdentifier() == OBJ_TABLE)
828                 {
829                     auto* pTableObject = dynamic_cast<sdr::table::SdrTableObj*>(mpMarkedObj);
>>>     CID 1453561:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "pTableObject" to "createTableEdgesJson", which dereferences it.
830                     bTableSelection = pTableObject->createTableEdgesJson(aTableJsonTree);
831     
832                     rtl::Reference<sdr::SelectionController> xController = static_cast<SdrView*>(this)->getSelectionController();
833                     if (xController.is() && xController->hasSelectedCells())
834                     {
835                         // The table shape has selected cells, which provide text selection already -> no graphic selection.

** CID 1453560:  Error handling issues  (CHECKED_RETURN)
/connectivity/source/drivers/firebird/DatabaseMetaData.cxx: 604 in connectivity::firebird::ODatabaseMetaData::getDatabaseProductVersion()()


________________________________________________________________________________________________________
*** CID 1453560:  Error handling issues  (CHECKED_RETURN)
/connectivity/source/drivers/firebird/DatabaseMetaData.cxx: 604 in connectivity::firebird::ODatabaseMetaData::getDatabaseProductVersion()()
598     
599     OUString SAL_CALL ODatabaseMetaData::getDatabaseProductVersion(  )
600     {
601         uno::Reference< XStatement > xSelect = m_pConnection->createStatement();
602     
603         uno::Reference< XResultSet > xRs = xSelect->executeQuery("SELECT rdb$get_context('SYSTEM', 'ENGINE_VERSION') as version from rdb$database");
>>>     CID 1453560:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "next" without checking return value (as is done elsewhere 185 out of 193 times).
604         xRs->next(); // first and only row
605         uno::Reference< XRow > xRow( xRs, UNO_QUERY_THROW );
606         return xRow->getString(1);
607     }
608     
609     OUString SAL_CALL ODatabaseMetaData::getDatabaseProductName(  )

** CID 1453559:  Error handling issues  (CHECKED_RETURN)
/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx: 367 in connectivity::mysqlc::ODatabaseMetaData::getUserName()()


________________________________________________________________________________________________________
*** CID 1453559:  Error handling issues  (CHECKED_RETURN)
/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx: 367 in connectivity::mysqlc::ODatabaseMetaData::getUserName()()
361     
362     OUString SAL_CALL ODatabaseMetaData::getUserName()
363     {
364         Reference<XStatement> statement = m_rConnection.createStatement();
365         Reference<XResultSet> rs = statement->executeQuery("select user()");
366         Reference<XRow> xRow(rs, UNO_QUERY_THROW);
>>>     CID 1453559:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "next" without checking return value (as is done elsewhere 185 out of 193 times).
367         rs->next(); // the first and only result
368         // e.g. root at localhost
369         OUString userWithConnection = xRow->getString(1);
370         sal_Int32 nIndexOfAt = userWithConnection.indexOf("@");
371         if (nIndexOfAt > 0)
372         {


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZBnDJeNb0HijxaS4JNJPxk3kpyAm2AYqo71yXmnOxB73RtgzoPcQtNNP5dkHLuV1E-3D_g-2BrHdvqzaBa155F-2F8AmPhpJzY63UzWDisJV95WUBpGhqFw1ICExHG8aMaV2EoFpyCHDb-2F4LSpJgcYLwj8hpneEa0EAMqoB9Y2xXWzVhWHOcXd57TOHZrsirSqHG7SDW73AhZRcEQvJbsFEHVLyD-2F0NQmcjiYkdQt8JznSAnIz9X9aQKTeNHaJovZ7LAn9ELq8-2B6hlPpSaB59sZs6kKw3p6FO3WyZ-2FeE53t91IoPFPS4-3D



More information about the LibreOffice mailing list