I1620: Properly range check character value before using as index (Coverity)

This commit is contained in:
Mark Pizzolato 2017-06-03 12:17:39 -07:00
parent fed2f126b1
commit d452c27c74

View file

@ -356,7 +356,8 @@ else { /* RA */
PAR = ADDR_A (PAR, -2); /* decr mem addr*/
return SCPE_OK;
}
else if (tti_to_alp[raw] < 0) { /* illegal char? */
else if ((raw >= sizeof(tti_to_alp)) || /* illegal char? */
(tti_to_alp[raw] < 0)) {
tto_write ('\a'); /* beep! */
return SCPE_OK;
}