Module Name:    src
Committed By:   martin
Date:           Tue Jul 23 12:37:23 UTC 2019

Modified Files:
        src/usr.sbin/sysinst: net.c

Log Message:
Avoid a buffer overrun with too many interfaces.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/sysinst/net.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/net.c
diff -u src/usr.sbin/sysinst/net.c:1.32 src/usr.sbin/sysinst/net.c:1.33
--- src/usr.sbin/sysinst/net.c:1.32	Mon Jul  8 19:46:57 2019
+++ src/usr.sbin/sysinst/net.c	Tue Jul 23 12:37:23 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: net.c,v 1.32 2019/07/08 19:46:57 martin Exp $	*/
+/*	$NetBSD: net.c,v 1.33 2019/07/23 12:37:23 martin Exp $	*/
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -260,7 +260,8 @@ get_ifconfig_info(struct net_desc *devs)
 		strlcpy (devs[i].if_dev, buf, STRSIZE);
 		i++;
 	}
-	strcpy(devs[i].if_dev, "\0");
+	if (i < MAX_NETS)
+		devs[i].if_dev[0] = 0;	/* XXX ? */
 
 	free(buf);
 	free(buf_in);

Reply via email to