New Defects reported by Coverity Scan for LibreOffice
scan-admin at coverity.com
scan-admin at coverity.com
Sat Jan 18 02:22:07 UTC 2025
Hi,
Please find the latest report on new defect(s) introduced to LibreOffice found with Coverity Scan.
7 new defect(s) introduced to LibreOffice found with Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 7 of 7 defect(s)
** CID 1640473: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/sc/source/core/data/validat.cxx: 429 in ScValidationData::DoError(weld::Window *, const rtl::OUString &, const ScAddress &, std::function<void (bool)>) const()
________________________________________________________________________________________________________
*** CID 1640473: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/sc/source/core/data/validat.cxx: 429 in ScValidationData::DoError(weld::Window *, const rtl::OUString &, const ScAddress &, std::function<void (bool)>) const()
423 xBox->set_default_response(RET_CANCEL);
424 break;
425 default:
426 break;
427 }
428
>>> CID 1640473: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "callback" is copied in call to copy constructor "std::function<void (bool)>", when it could be moved instead.
429 xBox->runAsync(xBox, [&, callback](sal_uInt32 result)
430 { callback(eErrorStyle == SC_VALERR_STOP || result == RET_CANCEL); });
431 }
432
433 bool ScValidationData::IsDataValidCustom(
434 const OUString& rTest,
** CID 1640472: Uninitialized members (UNINIT_CTOR)
/sc/source/core/data/validat.cxx: 429 in ScValidationData::DoError(weld::Window *, const rtl::OUString &, const ScAddress &, std::function<void (bool)>) const::[lambda(unsigned int) (instance 1)]::lambda([lambda(unsigned int) (instance 1)]&&)()
________________________________________________________________________________________________________
*** CID 1640472: Uninitialized members (UNINIT_CTOR)
/sc/source/core/data/validat.cxx: 429 in ScValidationData::DoError(weld::Window *, const rtl::OUString &, const ScAddress &, std::function<void (bool)>) const::[lambda(unsigned int) (instance 1)]::lambda([lambda(unsigned int) (instance 1)]&&)()
423 xBox->set_default_response(RET_CANCEL);
424 break;
425 default:
426 break;
427 }
428
>>> CID 1640472: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "this" is not initialized in this constructor nor in any functions that it calls.
429 xBox->runAsync(xBox, [&, callback](sal_uInt32 result)
430 { callback(eErrorStyle == SC_VALERR_STOP || result == RET_CANCEL); });
431 }
432
433 bool ScValidationData::IsDataValidCustom(
434 const OUString& rTest,
** CID 1640471: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/cui/source/dialogs/SignSignatureLineDialog.cxx: 167 in SignSignatureLineDialog::chooseCertificate(weld::Button &)()
________________________________________________________________________________________________________
*** CID 1640471: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/cui/source/dialogs/SignSignatureLineDialog.cxx: 167 in SignSignatureLineDialog::chooseCertificate(weld::Button &)()
161 = svx::SignatureLineHelper::getSignatureCertificate(pShell, nullptr, m_xDialog.get());
162
163 if (xSignCertificate.is())
164 {
165 m_xSelectedCertifate = xSignCertificate;
166 svl::crypto::CertificateOrName aCertificateOrName;
>>> CID 1640471: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "xSignCertificate" is copied in a call to copy assignment "operator =", when it could be moved instead.
167 aCertificateOrName.m_xCertificate = xSignCertificate;
168 m_xBtnChooseCertificate->set_label(
169 svx::SignatureLineHelper::getSignerName(aCertificateOrName));
170 }
171 ValidateFields();
172 }
** CID 1640470: Uninitialized members (UNINIT_CTOR)
/sc/source/core/data/validat.cxx: 429 in ScValidationData::DoError(weld::Window *, const rtl::OUString &, const ScAddress &, std::function<void (bool)>) const::[lambda(unsigned int) (instance 1)]::lambda(const [lambda(unsigned int) (instance 1)]&)()
________________________________________________________________________________________________________
*** CID 1640470: Uninitialized members (UNINIT_CTOR)
/sc/source/core/data/validat.cxx: 429 in ScValidationData::DoError(weld::Window *, const rtl::OUString &, const ScAddress &, std::function<void (bool)>) const::[lambda(unsigned int) (instance 1)]::lambda(const [lambda(unsigned int) (instance 1)]&)()
423 xBox->set_default_response(RET_CANCEL);
424 break;
425 default:
426 break;
427 }
428
>>> CID 1640470: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "this" is not initialized in this constructor nor in any functions that it calls.
429 xBox->runAsync(xBox, [&, callback](sal_uInt32 result)
430 { callback(eErrorStyle == SC_VALERR_STOP || result == RET_CANCEL); });
431 }
432
433 bool ScValidationData::IsDataValidCustom(
434 const OUString& rTest,
** CID 1640469: (NULL_RETURNS)
________________________________________________________________________________________________________
*** CID 1640469: (NULL_RETURNS)
/sc/source/ui/miscdlgs/optsolver.cxx: 1360 in ScOptSolverDlg::CallSolver()()
1354 aOutput.newLine();
1355 }
1356
1357 // Disable grid lines in the sensitivity report
1358 ScViewData& aData = ScTabViewShell::GetActiveViewShell()->GetViewData();
1359 aData.SetTabNo(nReportTab);
>>> CID 1640469: (NULL_RETURNS)
>>> Dereferencing a pointer that might be "nullptr" "aData" when calling "SetShowGrid".
1360 aData.SetShowGrid(false);
1361 aData.SetTabNo(mnCurTab);
1362 }
1363 }
1364
1365 return bClose;
1366 }
1367
/sc/source/ui/miscdlgs/optsolver.cxx: 1359 in ScOptSolverDlg::CallSolver()()
1353 aOutput.writeValue(aConstrAllowableIncreases[i]);
1354 aOutput.newLine();
1355 }
1356
1357 // Disable grid lines in the sensitivity report
1358 ScViewData& aData = ScTabViewShell::GetActiveViewShell()->GetViewData();
>>> CID 1640469: (NULL_RETURNS)
>>> Dereferencing a pointer that might be "nullptr" "aData" when calling "SetTabNo".
1359 aData.SetTabNo(nReportTab);
1360 aData.SetShowGrid(false);
1361 aData.SetTabNo(mnCurTab);
1362 }
1363 }
1364
1365 return bClose;
1366 }
1367
** CID 1640468: Null pointer dereferences (FORWARD_NULL)
________________________________________________________________________________________________________
*** CID 1640468: Null pointer dereferences (FORWARD_NULL)
/sw/source/ui/dbui/mmresultdialogs.cxx: 1107 in SwMMResultEmailDialog::SendDocumentsHdl_Impl(weld::Button &)()
1101 std::shared_ptr<const SfxFilter> pTargetSfxFlt = SwIoSystem::GetFilterOfFormat(
1102 FILTER_XML,
1103 SwDocShell::Factory().GetFilterContainer() );
1104
1105 uno::Sequence< beans::PropertyValue > aValues { comphelper::makePropertyValue(u"FilterName"_ustr, pTargetSfxFlt->GetFilterName()) };
1106
>>> CID 1640468: Null pointer dereferences (FORWARD_NULL)
>>> Passing null pointer "pTargetView" to "GetDocShell", which dereferences it.
1107 uno::Reference< frame::XStorable > xStore( pTargetView->GetDocShell()->GetModel(), uno::UNO_QUERY);
1108 xStore->storeToURL( sTargetTempURL, aValues );
1109
1110 //create the send dialog
1111 std::shared_ptr<SwSendMailDialog> xDlg = std::make_shared<SwSendMailDialog>(Application::GetDefDialogParent(), *xConfigItem);
1112
** CID 1640467: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/desktop/source/lib/init.cxx: 4774 in doc_initializeForRendering(_LibreOfficeKitDocument *, const char *)()
________________________________________________________________________________________________________
*** CID 1640467: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
/desktop/source/lib/init.cxx: 4774 in doc_initializeForRendering(_LibreOfficeKitDocument *, const char *)()
4768 if (!aSignatureCert.empty() && !aSignatureKey.empty())
4769 {
4770 uno::Reference<security::XCertificate> xCertificate = SfxLokHelper::getSigningCertificate(aSignatureCert, aSignatureKey);
4771 if (SfxViewShell* pViewShell = SfxViewShell::Current())
4772 {
4773 svl::crypto::CertificateOrName aCertificateOrName;
>>> CID 1640467: Performance inefficiencies (COPY_INSTEAD_OF_MOVE)
>>> "xCertificate" is copied in a call to copy assignment "operator =", when it could be moved instead.
4774 aCertificateOrName.m_xCertificate = xCertificate;
4775 pViewShell->SetSigningCertificate(aCertificateOrName);
4776 }
4777 }
4778
4779 pDoc->initializeForTiledRendering(comphelper::containerToSequence(aArgs));
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/libreoffice?tab=overview
More information about the LibreOffice
mailing list