From c9d2ed8044bda167688fc76c68336f751ba75281 Mon Sep 17 00:00:00 2001
From: rswindell <>
Date: Tue, 20 Jul 2004 01:13:04 +0000
Subject: [PATCH] ulist() option list can be terminated by a NULL pointer.

---
 src/uifc/uifc.c   | 2 +-
 src/uifc/uifc32.c | 2 +-
 src/uifc/uifcc.c  | 2 +-
 src/uifc/uifcd.c  | 2 +-
 src/uifc/uifcx.c  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/uifc/uifc.c b/src/uifc/uifc.c
index daece59db0..10deca01a5 100644
--- a/src/uifc/uifc.c
+++ b/src/uifc/uifc.c
@@ -374,7 +374,7 @@ if(mode&WIN_GET) bline|=BL_GET;
 if(mode&WIN_PUT) bline|=BL_PUT;
 bottomline(bline);
 while(opts<max_opts && opts<MAX_OPTS)
-	if(option[opts][0]==0)
+	if(option[opts]==NULL || option[opts][0]==0)
 		break;
 	else opts++;
 if(mode&WIN_XTR && opts<max_opts && opts<MAX_OPTS)
diff --git a/src/uifc/uifc32.c b/src/uifc/uifc32.c
index 5b6c5e267d..e0a77fffd8 100644
--- a/src/uifc/uifc32.c
+++ b/src/uifc/uifc32.c
@@ -636,7 +636,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
 	if(mode&WIN_PUT) bline|=BL_PUT;
 	bottomline(bline);
 	while(opts<MAX_OPTS)
-		if(option[opts][0]==0)
+		if(option[opts]==NULL || option[opts][0]==0)
 			break;
 		else opts++;
 	if(mode&WIN_XTR && opts<MAX_OPTS)
diff --git a/src/uifc/uifcc.c b/src/uifc/uifcc.c
index 143f116a84..1f5d1b42ec 100644
--- a/src/uifc/uifcc.c
+++ b/src/uifc/uifcc.c
@@ -422,7 +422,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
 	if(mode&WIN_PUT) bline|=BL_PUT;
 	bottomline(bline);
 	while(opts<max_opts && opts<MAX_OPTS)
-		if(option[opts][0]==0)
+		if(option[opts]==NULL || option[opts][0]==0)
 			break;
 		else opts++;
 	if(mode&WIN_XTR && opts<max_opts && opts<MAX_OPTS)
diff --git a/src/uifc/uifcd.c b/src/uifc/uifcd.c
index 1ad6f95b64..6149f53818 100644
--- a/src/uifc/uifcd.c
+++ b/src/uifc/uifcd.c
@@ -135,7 +135,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
 
 	/* Count number of menu options */
     for(cnt=0;cnt<MAX_OPTS;cnt++)
-		if(option[cnt][0]==0)
+		if(option[cnt]==NULL || option[cnt][0]==0)
 	   		break;
 	options=cnt;
 	freecnt=cnt+5;	/* Add, Delete, Copy, Paste, At End */
diff --git a/src/uifc/uifcx.c b/src/uifc/uifcx.c
index 196299d2ee..f8bc8cd43d 100644
--- a/src/uifc/uifcx.c
+++ b/src/uifc/uifcx.c
@@ -200,7 +200,7 @@ int ulist(int mode, int left, int top, int width, int *cur, int *bar
     int lines;
 
     for(opts=0;opts<MAX_OPTS;opts++)
-    	if(option[opts][0]==0)
+    	if(option[opts]==NULL || option[opts][0]==0)
     		break;
 
     if((*cur)>=opts)
-- 
GitLab