New Defects reported by Coverity Scan for LibreOffice

scan-admin at coverity.com scan-admin at coverity.com
Sat Mar 14 23:58:10 UTC 2020


Hi,

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

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


** CID 1460667:  Incorrect expression  (PW.ASSIGN_WHERE_COMPARE_MEANT)
/writerfilter/source/dmapper/DomainMapperTableManager.cxx: 722 in ()


________________________________________________________________________________________________________
*** CID 1460667:  Incorrect expression  (PW.ASSIGN_WHERE_COMPARE_MEANT)
/writerfilter/source/dmapper/DomainMapperTableManager.cxx: 722 in ()
716     #endif
717             insertRowProps(pPropMap);
718         }
719         else if ( !pCellWidths->empty() &&
720                    ( m_nLayoutType == NS_ooxml::LN_Value_doc_ST_TblLayout_fixed
721                      || pCellWidths->size() == ( nGrids + m_nGridAfter )
>>>     CID 1460667:  Incorrect expression  (PW.ASSIGN_WHERE_COMPARE_MEANT)
>>>     use of "=" where "==" may have been intended
722                      || ((bIsIncompleteGrid = true) && nGrids + m_nGridAfter > pTableGrid->size() && pCellWidths->size() > 0) )
723                  )
724         {
725             // If we're here, then the number of cells does not equal to the amount
726             // defined by the grid, even after taking care of
727             // gridSpan/gridBefore/gridAfter. Handle this by ignoring the grid and

** CID 1460666:  Error handling issues  (CHECKED_RETURN)
/sc/source/ui/view/cellsh1.cxx: 1509 in ScCellShell::ExecuteEdit(SfxRequest &)()


________________________________________________________________________________________________________
*** CID 1460666:  Error handling issues  (CHECKED_RETURN)
/sc/source/ui/view/cellsh1.cxx: 1509 in ScCellShell::ExecuteEdit(SfxRequest &)()
1503                 const uno::Reference<datatransfer::XTransferable>& xTransferable
1504                     = aDataHelper.GetTransferable();
1505                 SotClipboardFormatId format = SotClipboardFormatId::STRING;
1506                 if (xTransferable.is() && HasClipboardFormat(format))
1507                 {
1508                     auto pStrBuffer = std::make_shared<OUString>();
>>>     CID 1460666:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "GetString" without checking return value (as is done elsewhere 26 out of 28 times).
1509                     aDataHelper.GetString(format, *pStrBuffer);
1510                     auto pStrm = std::make_shared<ScImportStringStream>(*pStrBuffer);
1511                     ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
1512                     VclPtr<AbstractScImportAsciiDlg> pDlg(pFact->CreateScImportAsciiDlg(
1513                         pWin ? pWin->GetFrameWeld() : nullptr, OUString(), pStrm.get(), SC_PASTETEXT));
1514                     ScRange aRange;

** CID 1460665:  Incorrect expression  (DIVIDE_BY_ZERO)
/sc/source/ui/dataprovider/datatransformation.cxx: 345 in sc::AggregateFunction::Transform(ScDocument &) const()


________________________________________________________________________________________________________
*** CID 1460665:  Incorrect expression  (DIVIDE_BY_ZERO)
/sc/source/ui/dataprovider/datatransformation.cxx: 345 in sc::AggregateFunction::Transform(ScDocument &) const()
339                         {
340                             double nVal = rDoc.GetValue(rCol, nRow, 0);
341                             nSum += nVal;
342                         }
343                     }
344     
>>>     CID 1460665:  Incorrect expression  (DIVIDE_BY_ZERO)
>>>     In expression "nSum / (nEndRow + 1)", division by expression "nEndRow + 1" which may be zero has undefined behavior.
345                     double nAvg = nSum / (nEndRow + 1);
346                     rDoc.SetValue(rCol, nEndRow + 1, 0, nAvg);
347                 }
348                 break;
349                 case AGGREGATE_FUNCTION::MIN:
350                 {


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/ls/click?upn=nJaKvJSIH-2FPAfmty-2BK5tYpPklAc1eEA-2F1zfUjH6teExViPHTTReBArhCRZ3BE4kCjKjDqn2Dq3ZyEbAvAs31gRpU3vMPHDnoSx68vDAWjNU-3DNJ59_OTq2XUZbbipYjyLSo6GRo-2FpVxQ9OzkDINu9UTS-2FQhSdO0F0jQniitrGlNxDIzPJiyHO9KzrrSCXxrycERtF8U2RqL-2Br5tk723WtVFpU28RQluDBP7TLaLnET9hsKWjq776U8e-2BhJQrsIIw3DJo-2FELyi4-2BIS3B3d9Qk26QT9wfNJTt1vfq-2BYVe2bDqBfUdPrxuS8JSSVoTlOI7LGznSz9N7u5FsQpQCTpmNqGnGBRiy7DdLKBR3pBqyJ7FLnPo058



More information about the LibreOffice mailing list