Browse Source

drivers: intc: nxp_pint: fix off-by-one error in pin_enable

Prevent out-of-bounds access in nxp_pint_pin_enable by fixing the
comparison to use >= instead of >.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
pull/86973/merge
Benjamin Cabé 3 weeks ago committed by Benjamin Cabé
parent
commit
48a1a2a248
  1. 2
      drivers/interrupt_controller/intc_nxp_pint.c

2
drivers/interrupt_controller/intc_nxp_pint.c

@ -69,7 +69,7 @@ int nxp_pint_pin_enable(uint8_t pin, enum nxp_pint_trigger trigger, bool wake) @@ -69,7 +69,7 @@ int nxp_pint_pin_enable(uint8_t pin, enum nxp_pint_trigger trigger, bool wake)
{
uint8_t slot = 0U;
if (pin > ARRAY_SIZE(pin_pint_id)) {
if (pin >= ARRAY_SIZE(pin_pint_id)) {
/* Invalid pin ID */
return -EINVAL;
}

Loading…
Cancel
Save