Module Name:    src
Committed By:   martin
Date:           Sun Jan  6 11:08:35 UTC 2019

Modified Files:
        src/usr.bin/menuc: menu_sys.def

Log Message:
Fix a potential NULL deref in previous - some menus start up with no
"opts" array allocated yet.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/usr.bin/menuc/menu_sys.def

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/menuc/menu_sys.def
diff -u src/usr.bin/menuc/menu_sys.def:1.62 src/usr.bin/menuc/menu_sys.def:1.63
--- src/usr.bin/menuc/menu_sys.def:1.62	Fri Jan  4 15:27:19 2019
+++ src/usr.bin/menuc/menu_sys.def	Sun Jan  6 11:08:34 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: menu_sys.def,v 1.62 2019/01/04 15:27:19 martin Exp $	*/
+/*	$NetBSD: menu_sys.def,v 1.63 2019/01/06 11:08:34 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -693,7 +693,7 @@ process_menu(int num, void *arg)
 	m->topline = 0;
 	if ((m->mopt & (MC_DFLTEXIT | MC_NOEXITOPT)) == MC_DFLTEXIT) {
 		m->cursel = -1;
-	} else {
+	} else if (m->opts != NULL) {
 		for (m->cursel = 0; m->cursel < m->numopts; m->cursel++)
 			if ((m->opts[m->cursel].opt_flags & OPT_IGNORE) == 0)
 				break;

Reply via email to