diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c index add21770a4832696c3d21a27e85775fa9b56621b..27b396a939d51feacd1d9faa314a50d47a26ce81 100644 --- a/src/uifc/uifc32.c +++ b/src/uifc/uifc32.c @@ -1716,6 +1716,8 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar if(/*!(api->mode&UIFC_NOCTRL)*/1) { // No no, *this* control key is fine! if (gotkey == CTRL_G || api->input(WIN_MID|WIN_SAV, 0, 0, "Find", search, sizeof(search), K_EDIT|K_FIND) > 0) { for (j = (*cur) + 1; j != *cur; j++, j = (j >= opts) ? 0 : j) { + if (option[j] == NULL || j >= opts) + continue; if (strcasestr(option[j], search) != NULL) { // Copy/pasted from search above. if(y+(j-(*cur))+2>height+top) {