Skip to content

Commit

Permalink
Merge pull request #35521 from smuzaffar/ubsan-CSCCathodeLCTProcessor…
Browse files Browse the repository at this point in the history
…-fix

[UBSAN] CSCCathodeLCTProcessor.cc: Fix runtime error index -1 out of bound
  • Loading branch information
cmsbuild authored Oct 7, 2021
2 parents d14b3f7 + 293214c commit aff49a5
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,10 @@ std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::findLCTs(
}
// temporary alias
const int best_hs(best_halfstrip[0]);
const int best_pat(best_pid[best_hs]);
// construct a CLCT if the trigger condition has been met
if (best_hs >= 0 && nhits[best_hs] >= nplanes_hit_pattern) {
// overwrite the current best CLCT
tempBestCLCT = constructCLCT(first_bx, best_hs, hits_in_patterns[best_hs][best_pat]);
tempBestCLCT = constructCLCT(first_bx, best_hs, hits_in_patterns[best_hs][best_pid[best_hs]]);
}
}
}
Expand All @@ -643,11 +642,10 @@ std::vector<CSCCLCTDigi> CSCCathodeLCTProcessor::findLCTs(
}
// temporary alias
const int best_hs(best_halfstrip[1]);
const int best_pat(best_pid[best_hs]);
// construct a CLCT if the trigger condition has been met
if (best_hs >= 0 && nhits[best_hs] >= nplanes_hit_pattern) {
// overwrite the current second best CLCT
tempSecondCLCT = constructCLCT(first_bx, best_hs, hits_in_patterns[best_hs][best_pat]);
tempSecondCLCT = constructCLCT(first_bx, best_hs, hits_in_patterns[best_hs][best_pid[best_hs]]);
}
}
// add the CLCTs to the collection
Expand Down

0 comments on commit aff49a5

Please sign in to comment.