Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/menuc Fixed array index checking to avoid segmentati...



details:   https://anonhg.NetBSD.org/src/rev/27215386373f
branches:  trunk
changeset: 552181:27215386373f
user:      takemura <takemura%NetBSD.org@localhost>
date:      Sun Sep 21 02:17:39 2003 +0000

description:
Fixed array index checking to avoid segmentation fault problem.

diffstat:

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

diffs (18 lines):

diff -r a7a74ffd899b -r 27215386373f usr.bin/menuc/menu_sys.def
--- a/usr.bin/menuc/menu_sys.def        Sun Sep 21 00:26:09 2003 +0000
+++ b/usr.bin/menuc/menu_sys.def        Sun Sep 21 02:17:39 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: menu_sys.def,v 1.45 2003/07/27 07:21:58 dsl Exp $      */
+/*     $NetBSD: menu_sys.def,v 1.46 2003/09/21 02:17:39 takemura Exp $ */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -691,7 +691,7 @@
 
        /* Find free menu entry. */
        for (ix = DYN_MENU_START; ; ix++) {
-               if (ix > num_menus && !double_menus())
+               if (ix >= num_menus && !double_menus())
                        return -1;
                if (!(menus[ix].mopt & MC_VALID))
                        break;



Home | Main Index | Thread Index | Old Index