From 5755ec14b9d392a04041a2f5580ca9a63e60be3e Mon Sep 17 00:00:00 2001 From: mmusich Date: Sun, 13 Mar 2022 21:46:44 +0100 Subject: [PATCH] prevent variable length array bound evaluates to non-positive value --- RecoTracker/DeDx/plugins/HLTDeDxFilter.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/RecoTracker/DeDx/plugins/HLTDeDxFilter.cc b/RecoTracker/DeDx/plugins/HLTDeDxFilter.cc index 2de6eded22f38..bc2e1984175d2 100644 --- a/RecoTracker/DeDx/plugins/HLTDeDxFilter.cc +++ b/RecoTracker/DeDx/plugins/HLTDeDxFilter.cc @@ -115,6 +115,11 @@ bool HLTDeDxFilter::hltFilter(edm::Event& iEvent, bool accept = false; int NTracks = 0; + + // early return + if (trackCollection.empty()) + return accept; + //fill local arrays for eta, phi, and pt float eta[trackCollection.size()], phi[trackCollection.size()], pt[trackCollection.size()]; for (unsigned int i = 0; i < trackCollection.size(); i++) {