Skip to content

Commit

Permalink
prevent variable length array bound evaluates to non-positive value
Browse files Browse the repository at this point in the history
  • Loading branch information
mmusich committed Mar 13, 2022
1 parent a41f340 commit 5755ec1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions RecoTracker/DeDx/plugins/HLTDeDxFilter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down

0 comments on commit 5755ec1

Please sign in to comment.