curletter is screened to be in valid range in all other switch/case branches except in the default case, which is fallthrough. Add check for valid range in here also, otherwise array might be addressed with invalid offset. This should fix the following, found with UBSAN and #debugfuzzer: ../win/curses/cursdial.c:1558:49: runtime error: index -154 out of bounds for type 'char [256]' 0x5f3857eff140 in menu_get_selections ../win/curses/cursdial.c:1558 0x5f3857ef78c8 in curses_display_nhmenu ../win/curses/cursdial.c:801 0x5f3857edd390 in curses_select_menu ../win/curses/cursmain.c:768
57 KiB
57 KiB