From 835eb0ff69b19730e0430c7a1635c7a176c9d5f2 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 19 Mar 2025 17:56:11 +0100
Subject: [PATCH 1/2] DataQualityUtils: fix potential nullptr deref (cppcheck)

---
 DataQuality/DataQualityUtils/src/MonitoringFile.cxx | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/DataQuality/DataQualityUtils/src/MonitoringFile.cxx b/DataQuality/DataQualityUtils/src/MonitoringFile.cxx
index 2e4405c451c1..0aec7785febb 100644
--- a/DataQuality/DataQualityUtils/src/MonitoringFile.cxx
+++ b/DataQuality/DataQualityUtils/src/MonitoringFile.cxx
@@ -352,6 +352,7 @@ namespace dqutils {
     const TH1* b1 = dynamic_cast<const TH1*>(b);
     if (!a1 || !b1) {
       std::cout << "ERROR, in merge_rebinned: Object not of type TH1";
+      return;
     }
     TH1* b2 = const_cast<TH1*>(b1);
     dqutils::MonitoringFile::merge_Rebinned(*a1, *b2);
@@ -363,6 +364,7 @@ namespace dqutils {
     const TH2* b1 = dynamic_cast<const TH2*>(b);
     if (!a1 || !b1) {
       std::cout << "ERROR in merge_eventSample: Object not of type TH2" << std::endl;
+      return;
     }
     dqutils::MonitoringFile::merge_eventSample(*a1, *b1);
   }
@@ -373,6 +375,7 @@ namespace dqutils {
     TEfficiency* b2 = const_cast<TEfficiency*>(b1);
     if (!a1 || !b1) {
       std::cout << "ERROR in merge_TEfficiency: Object not of type TEfficiency" << std::endl;
+      return;
     }
     TList listE;
     listE.Add(b2);
-- 
GitLab


From d52bd293a35f3214d90a9ea684ff5e826796ba08 Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Wed, 19 Mar 2025 17:51:59 +0100
Subject: [PATCH 2/2] LArShapeDumper: cppcheck fix [uninitMemberVar]

---
 LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx b/LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx
index 8240ba481b36..6ff79f312fdc 100755
--- a/LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx
+++ b/LArCalorimeter/LArCafJobs/src/LArShapeDumper.cxx
@@ -48,6 +48,7 @@ LArShapeDumper::LArShapeDumper(const std::string & name, ISvcLocator * pSvcLocat
   m_nNoDigits(0),
   m_nNoDigitsSC(0),
   m_onlineHelper(nullptr),
+  m_onlineHelperSC(nullptr),
   m_doEM(false),
   m_doHEC(false),
   m_doFCAL(false),
-- 
GitLab