From b9f0dfc83878d02f054bed3f132ca74e6ccf312b Mon Sep 17 00:00:00 2001 From: shahoian Date: Sun, 26 May 2024 22:42:32 +0200 Subject: [PATCH] Check for ITS cableID mapper out of bound access --- .../include/ITSMFTReconstruction/ChipMappingITS.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/ChipMappingITS.h b/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/ChipMappingITS.h index b8add5f8106c2..9ba894208d45d 100644 --- a/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/ChipMappingITS.h +++ b/Detectors/ITSMFT/common/reconstruction/include/ITSMFTReconstruction/ChipMappingITS.h @@ -199,7 +199,7 @@ class ChipMappingITS uint8_t cableHW2Pos(uint8_t ruType, uint8_t hwid) const { return mCableHW2Pos[ruType][hwid]; } ///< convert HW cable ID to SW ID for given RU type (see ChipOnRUInfo.cableSW explanation) - uint8_t cableHW2SW(uint8_t ruType, uint8_t hwid) const { return mCableHW2SW[ruType][hwid]; } + uint8_t cableHW2SW(uint8_t ruType, uint8_t hwid) const { return hwid < mCableHW2SW[ruType].size() ? mCableHW2SW[ruType][hwid] : 0xff; } ///< convert cable iterator ID to the position on the ActiveLanes word in the GBT.header for given RU type; MFT lanes position compatible uint8_t cablePos(uint8_t ruType, uint8_t id) const { return mCablePos[ruType][id]; }