From c901d22591dcd8e62db07524d87496b7ab180ace Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Mon, 13 Apr 2020 07:21:23 +0000
Subject: [PATCH] Actually, this commit fixes the crash... I wasn't high enough
 up in the tree to commit both at once.

There was a crash when wrapping at the end of a search.  Now there isn't.
You're welcome.
---
 src/uifc/uifc32.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c
index add21770a4..27b396a939 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) {
-- 
GitLab