<div dir="auto">We don't think you should assert or generate a fatal error after initialization. This could cause an unknown, but safety critical, application to fail.<div dir="auto"><br></div><div dir="auto">This same logic should be converted to a run-time error.<br></div><div dir="auto"><br></div><div dir="auto">This is probably guidance that is or should be in the coding style in the software engineering guide. If it isn't, please let us know. It needs a small tasks ticket.</div><div dir="auto"><br></div><div dir="auto">--joel</div><br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">On Sat, Mar 28, 2020, 5:50 AM G S Niteesh Babu <<a href="mailto:niteesh.gs@gmail.com">niteesh.gs@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fixes "array subscript is outside array bounds" in gpio-support.c<br>
---<br>
bsps/shared/dev/gpio/gpio-support.c | 1 +<br>
1 file changed, 1 insertion(+)<br>
<br>
diff --git a/bsps/shared/dev/gpio/gpio-support.c b/bsps/shared/dev/gpio/gpio-support.c<br>
index 9c053dc151..04f1c8ca90 100644<br>
--- a/bsps/shared/dev/gpio/gpio-support.c<br>
+++ b/bsps/shared/dev/gpio/gpio-support.c<br>
@@ -325,6 +325,7 @@ static rtems_status_code get_pin_bitmask(<br>
ACQUIRE_LOCK(gpio_bank_state[bank].lock);<br>
}<br>
else if ( bank != *bank_number ) {<br>
+ assert ( *bank_number >= 0 && *bank_number < GPIO_BANK_COUNT );<br>
RELEASE_LOCK(gpio_bank_state[*bank_number].lock);<br>
<br>
return RTEMS_UNSATISFIED;<br>
-- <br>
2.17.1<br>
<br>
</blockquote></div></div>