fix: prevent out of bounds access if g_eeGeneral.templateSetup has an invalid value

This commit is contained in:
Raphael Coeffic
2022-09-20 08:05:34 +02:00
parent bccae96917
commit d6764ca0f8
+1
View File
@@ -69,6 +69,7 @@ const uint8_t bchout_ar[] = {
uint8_t channelOrder(uint8_t setup, uint8_t x)
{
if (setup >= sizeof(bchout_ar)) return x;
return ((*(bchout_ar + setup) >> (6 - (x - 1) * 2)) & 3) + 1;
}