Skip to content

Commit 48a1a2a

Browse files
committed
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>
1 parent 8c385be commit 48a1a2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/interrupt_controller/intc_nxp_pint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ int nxp_pint_pin_enable(uint8_t pin, enum nxp_pint_trigger trigger, bool wake)
6969
{
7070
uint8_t slot = 0U;
7171

72-
if (pin > ARRAY_SIZE(pin_pint_id)) {
72+
if (pin >= ARRAY_SIZE(pin_pint_id)) {
7373
/* Invalid pin ID */
7474
return -EINVAL;
7575
}

0 commit comments

Comments
 (0)