Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sysinst Enlarge the set_status[] array by a single ...



details:   https://anonhg.NetBSD.org/src/rev/e84aad55fe8d
branches:  trunk
changeset: 323639:e84aad55fe8d
user:      kamil <kamil%NetBSD.org@localhost>
date:      Sat Jun 23 22:35:29 2018 +0000

description:
Enlarge the set_status[] array by a single element

In the get_and_unpack_sets() function there is accessed the
set_status[SET_GROUP_END] element in the array. The array is allocated on
the stack with SET_GROUP_END elements. This means that it is 1 element too
short.

This has been reported with MKSANITIZER=yes with Address Sanitizer.

diffstat:

 usr.sbin/sysinst/util.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 8adf4b1e9bd7 -r e84aad55fe8d usr.sbin/sysinst/util.c
--- a/usr.sbin/sysinst/util.c   Sat Jun 23 20:15:23 2018 +0000
+++ b/usr.sbin/sysinst/util.c   Sat Jun 23 22:35:29 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: util.c,v 1.9 2018/06/21 23:05:28 kamil Exp $   */
+/*     $NetBSD: util.c,v 1.10 2018/06/23 22:35:29 kamil Exp $  */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -78,7 +78,7 @@
 static const char *msg_cur_distsets_row;
 static int select_menu_width;
 
-static uint8_t set_status[SET_GROUP_END];
+static uint8_t set_status[SET_GROUP_END + 1];
 #define SET_VALID      0x01
 #define SET_SELECTED   0x02
 #define SET_SKIPPED    0x04



Home | Main Index | Thread Index | Old Index