Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/menuc Fix a potential NULL deref in previous - some ...



details:   https://anonhg.NetBSD.org/src/rev/88ca423639b6
branches:  trunk
changeset: 447279:88ca423639b6
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jan 06 11:08:34 2019 +0000

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

diffstat:

 usr.bin/menuc/menu_sys.def |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 8903ffd90831 -r 88ca423639b6 usr.bin/menuc/menu_sys.def
--- a/usr.bin/menuc/menu_sys.def        Sun Jan 06 04:27:53 2019 +0000
+++ b/usr.bin/menuc/menu_sys.def        Sun Jan 06 11:08:34 2019 +0000
@@ -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 @@
        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;



Home | Main Index | Thread Index | Old Index