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 1666320:       Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/sc/source/ui/view/cellsh2.cxx: 957           in 
ScCellShell::ExecuteDB(SfxRequest &)()


_____________________________________________________________________________________________
*** CID 1666320:         Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/sc/source/ui/view/cellsh2.cxx: 957             in 
ScCellShell::ExecuteDB(SfxRequest &)()
951                             std::shared_ptr<ScValidationRegisteredDlg> 
aRegisterThatDlgExists;
952                         };
953     
954                         std::shared_ptr<lcl_auxData> xAuxData = 
std::make_shared<lcl_auxData>(
955                             lcl_auxData{ aCursorPos, eMode, eOper, aExpr1, 
aExpr2, bBlank, nListType,
956                                          bShowHelp, aHelpTitle, aHelpText, 
bShowError, eErrStyle,
>>>     CID 1666320:         Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "pRegisterThatDlgExists" is passed-by-value as parameter to 
>>> "std::shared_ptr<<unnamed>::ScValidationRegisteredDlg>::shared_ptr(std::shared_ptr<<unnamed>::ScValidationRegisteredDlg>
>>>  const &) /*explicit =default*/", when it could be moved instead.
957                                          aErrTitle, aErrText, 
bCaseSensitive, pRegisterThatDlgExists });
958     
959                         auto xRequest = std::make_shared<SfxRequest>(rReq);
960                         rReq.Ignore(); // the 'old' request is not relevant 
any more
961                         SfxTabDialogController::runAsync(
962                             xDlg,

** CID 1666319:         (DIVIDE_BY_ZERO)
/vcl/source/bitmap/bitmap.cxx: 2172           in Bitmap::GetAverageColor() 
const()
/vcl/source/bitmap/bitmap.cxx: 2172           in Bitmap::GetAverageColor() 
const()
/vcl/source/bitmap/bitmap.cxx: 2172           in Bitmap::GetAverageColor() 
const()
/vcl/source/bitmap/bitmap.cxx: 2172           in Bitmap::GetAverageColor() 
const()


_____________________________________________________________________________________________
*** CID 1666319:           (DIVIDE_BY_ZERO)
/vcl/source/bitmap/bitmap.cxx: 2172             in Bitmap::GetAverageColor() 
const()
2166                 fGreen += aCol.GetGreen();
2167                 fBlue += aCol.GetBlue();
2168                 fAlpha += aCol.GetAlpha();
2169                 nCnt++;
2170             }
2171         }
>>>     CID 1666319:           (DIVIDE_BY_ZERO)
>>>     In expression "fGreen / nCnt", division by expression "nCnt" which may 
>>> be zero has undefined behavior.
2172         return Color(ColorAlpha, static_cast<sal_uInt8>(fAlpha / nCnt),
2173                        static_cast<sal_uInt8>(fRed / nCnt),
2174                        static_cast<sal_uInt8>(fGreen / nCnt),
2175                        static_cast<sal_uInt8>(fBlue / nCnt));
2176     }
2177     
/vcl/source/bitmap/bitmap.cxx: 2172             in Bitmap::GetAverageColor() 
const()
2166                 fGreen += aCol.GetGreen();
2167                 fBlue += aCol.GetBlue();
2168                 fAlpha += aCol.GetAlpha();
2169                 nCnt++;
2170             }
2171         }
>>>     CID 1666319:           (DIVIDE_BY_ZERO)
>>>     In expression "fRed / nCnt", division by expression "nCnt" which may be 
>>> zero has undefined behavior.
2172         return Color(ColorAlpha, static_cast<sal_uInt8>(fAlpha / nCnt),
2173                        static_cast<sal_uInt8>(fRed / nCnt),
2174                        static_cast<sal_uInt8>(fGreen / nCnt),
2175                        static_cast<sal_uInt8>(fBlue / nCnt));
2176     }
2177     
/vcl/source/bitmap/bitmap.cxx: 2172             in Bitmap::GetAverageColor() 
const()
2166                 fGreen += aCol.GetGreen();
2167                 fBlue += aCol.GetBlue();
2168                 fAlpha += aCol.GetAlpha();
2169                 nCnt++;
2170             }
2171         }
>>>     CID 1666319:           (DIVIDE_BY_ZERO)
>>>     In expression "fAlpha / nCnt", division by expression "nCnt" which may 
>>> be zero has undefined behavior.
2172         return Color(ColorAlpha, static_cast<sal_uInt8>(fAlpha / nCnt),
2173                        static_cast<sal_uInt8>(fRed / nCnt),
2174                        static_cast<sal_uInt8>(fGreen / nCnt),
2175                        static_cast<sal_uInt8>(fBlue / nCnt));
2176     }
2177     
/vcl/source/bitmap/bitmap.cxx: 2172             in Bitmap::GetAverageColor() 
const()
2166                 fGreen += aCol.GetGreen();
2167                 fBlue += aCol.GetBlue();
2168                 fAlpha += aCol.GetAlpha();
2169                 nCnt++;
2170             }
2171         }
>>>     CID 1666319:           (DIVIDE_BY_ZERO)
>>>     In expression "fBlue / nCnt", division by expression "nCnt" which may 
>>> be zero has undefined behavior.
2172         return Color(ColorAlpha, static_cast<sal_uInt8>(fAlpha / nCnt),
2173                        static_cast<sal_uInt8>(fRed / nCnt),
2174                        static_cast<sal_uInt8>(fGreen / nCnt),
2175                        static_cast<sal_uInt8>(fBlue / nCnt));
2176     }
2177     

** CID 1666318:       Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/oox/source/export/ThemeExport.cxx: 45           in 
oox::ThemeExport::ThemeExport(oox::core::XmlFilterBase *, 
oox::drawingml::DocumentType, 
std::shared_ptr<sax_fastparser::FastSerializerHelper>)()


_____________________________________________________________________________________________
*** CID 1666318:         Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
/oox/source/export/ThemeExport.cxx: 45             in 
oox::ThemeExport::ThemeExport(oox::core::XmlFilterBase *, 
oox::drawingml::DocumentType, 
std::shared_ptr<sax_fastparser::FastSerializerHelper>)()
39     
40     ThemeExport::ThemeExport(oox::core::XmlFilterBase* pFilterBase,
41                              oox::drawingml::DocumentType eDocumentType,
42                              sax_fastparser::FSHelperPtr pFS)
43         : mpFilterBase(pFilterBase)
44         , meDocumentType(eDocumentType)
>>>     CID 1666318:         Performance inefficiencies  (COPY_INSTEAD_OF_MOVE)
>>>     "pFS" is passed-by-value as parameter to 
>>> "std::shared_ptr<sax_fastparser::FastSerializerHelper>::shared_ptr(std::shared_ptr<sax_fastparser::FastSerializerHelper>
>>>  const &) /*explicit =default*/", when it could be moved instead.
45         , mpFS(pFS)
46     {
47     }
48     
49     void ThemeExport::write(OUString const& rPath, model::Theme const& 
rTheme)
50     {

** CID 1666317:       Control flow issues  (DEADCODE)
/oox/source/export/chartexport.cxx: 2364           in 
oox::drawingml::ChartExport::exportTitle(const 
com::sun::star::uno::Reference<com::sun::star::drawing::XShape> &, bool, const 
com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::chart2::XFormattedString>>
 &)()


_____________________________________________________________________________________________
*** CID 1666317:         Control flow issues  (DEADCODE)
/oox/source/export/chartexport.cxx: 2364             in 
oox::drawingml::ChartExport::exportTitle(const 
com::sun::star::uno::Reference<com::sun::star::drawing::XShape> &, bool, const 
com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::chart2::XFormattedString>>
 &)()
2358         }
2359     
2360         if (!bIsChartex) {
2361             // shape properties
2362             if( xPropSet.is() )
2363             {
>>>     CID 1666317:         Control flow issues  (DEADCODE)
>>>     Execution cannot reach the expression "1604" inside this statement: 
>>> "this->exportShapeProps(xPro...".
2364                 exportShapeProps( xPropSet, bIsChartex ? XML_cx : XML_c );
2365             }
2366         }
2367     
2368         if (bIsChartex) {
2369             pFS->endElement( FSNS( XML_cx, XML_title ) );

** CID 1666316:         (UNINIT_CTOR)
/sal/rtl/math.cxx: 244           in <unnamed>::stringToDouble<unsigned 
char>(const T1 *, const T1 *, T1, T1, rtl_math_ConversionStatus *, const T1 
**)::Buf_t::Buf_t(unsigned long)()
/sal/rtl/math.cxx: 244           in <unnamed>::stringToDouble<unsigned 
char>(const T1 *, const T1 *, T1, T1, rtl_math_ConversionStatus *, const T1 
**)::Buf_t::Buf_t(unsigned long)()


_____________________________________________________________________________________________
*** CID 1666316:           (UNINIT_CTOR)
/sal/rtl/math.cxx: 244             in <unnamed>::stringToDouble<unsigned 
char>(const T1 *, const T1 *, T1, T1, rtl_math_ConversionStatus *, const T1 
**)::Buf_t::Buf_t(unsigned long)()
238                     {
239                         stringInHeap = std::make_unique<char[]>(bufsize);
240                         mapInHeap = std::make_unique<const CharT* 
[]>(bufsize);
241                         string = stringInHeap.get();
242                         map = mapInHeap.get();
243                     }
>>>     CID 1666316:           (UNINIT_CTOR)
>>>     Non-static class member "mapOnStack" is not initialized in this 
>>> constructor nor in any functions that it calls.
244                 }
245                 // [-loplugin:unusedmember] false positive
246                 void insert(char c, const CharT* ptr)
247                 {
248                     string[pos] = c;
249                     map[pos] = ptr;
/sal/rtl/math.cxx: 244             in <unnamed>::stringToDouble<unsigned 
char>(const T1 *, const T1 *, T1, T1, rtl_math_ConversionStatus *, const T1 
**)::Buf_t::Buf_t(unsigned long)()
238                     {
239                         stringInHeap = std::make_unique<char[]>(bufsize);
240                         mapInHeap = std::make_unique<const CharT* 
[]>(bufsize);
241                         string = stringInHeap.get();
242                         map = mapInHeap.get();
243                     }
>>>     CID 1666316:           (UNINIT_CTOR)
>>>     Non-static class member "mapOnStack" is not initialized in this 
>>> constructor nor in any functions that it calls.
244                 }
245                 // [-loplugin:unusedmember] false positive
246                 void insert(char c, const CharT* ptr)
247                 {
248                     string[pos] = c;
249                     map[pos] = ptr;


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

Reply via email to