Module Name:    src
Committed By:   martin
Date:           Thu Jul 12 15:18:45 UTC 2018

Modified Files:
        src/usr.sbin/sysinst [netbsd-8]: util.c

Log Message:
Pull up following revision(s) (requested by kamil in ticket #900):

        usr.sbin/sysinst/util.c: revision 1.10,1.11

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.

 -

Revert previous, fix iteration loops to be consistent:
All sets that have an id >= SET_LAST have NULL name, so use that like the
loop just below.


To generate a diff of this commit:
cvs rdiff -u -r1.7.8.2 -r1.7.8.3 src/usr.sbin/sysinst/util.c

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

Modified files:

Index: src/usr.sbin/sysinst/util.c
diff -u src/usr.sbin/sysinst/util.c:1.7.8.2 src/usr.sbin/sysinst/util.c:1.7.8.3
--- src/usr.sbin/sysinst/util.c:1.7.8.2	Sat Jun 23 11:09:24 2018
+++ src/usr.sbin/sysinst/util.c	Thu Jul 12 15:18:45 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: util.c,v 1.7.8.2 2018/06/23 11:09:24 martin Exp $	*/
+/*	$NetBSD: util.c,v 1.7.8.3 2018/07/12 15:18:45 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -1010,16 +1010,15 @@ get_and_unpack_sets(int update, msg setu
 
 	/* Accurately count selected sets */
 	for (dist = dist_list; (set = dist->set) != SET_LAST; dist++) {
+		if (dist->name == NULL)
+			continue;
 		if ((set_status[set] & (SET_VALID | SET_SELECTED))
 		    == (SET_VALID | SET_SELECTED))
 			tarstats.nselected++;
 	}
 
 	status = SET_RETRY;
-	for (dist = dist_list; ; dist++) {
-		set = dist->set;
-		if (set == SET_LAST)
-			break;
+	for (dist = dist_list; (set = dist->set) != SET_LAST; dist++) {
 		if (dist->name == NULL)
 			continue;
 		if (set_status[set] != (SET_VALID | SET_SELECTED))

Reply via email to