Source-Changes-HG archive

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

[src/netbsd-8]: src/usr.sbin/sysinst Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/68291915fd02
branches:  netbsd-8
changeset: 435112:68291915fd02
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Jul 12 15:18:45 2018 +0000

description:
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.

diffstat:

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

diffs (29 lines):

diff -r f16f4a71154a -r 68291915fd02 usr.sbin/sysinst/util.c
--- a/usr.sbin/sysinst/util.c   Thu Jul 12 15:11:56 2018 +0000
+++ b/usr.sbin/sysinst/util.c   Thu Jul 12 15:18:45 2018 +0000
@@ -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 @@
 
        /* 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))



Home | Main Index | Thread Index | Old Index