mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-25 17:27:18 +00:00
Adding index check on fake_GPIO setCallback to avoid repeat of issue #113 in the future.
This commit is contained in:
@@ -65,6 +65,10 @@ static int FakeGpio_setCallback(const OcGpio_Pin *pin,
|
||||
return OCGPIO_FAILURE;
|
||||
}
|
||||
|
||||
if (pin->idx >= FAKE_GPIO_PIN_COUNT) {
|
||||
return OCGPIO_FAILURE;
|
||||
}
|
||||
|
||||
obj->callback[pin->idx].fn = callback;
|
||||
obj->callback[pin->idx].context = context;
|
||||
return OCGPIO_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user