svn commit: r308891 - stable/11/sbin/etherswitchcfg

Luiz Otavio O Souza loos at FreeBSD.org
Sun Nov 20 17:03:54 UTC 2016


Author: loos
Date: Sun Nov 20 17:03:52 2016
New Revision: 308891
URL: https://svnweb.freebsd.org/changeset/base/308891

Log:
  Zero etherswitch_vlangroup structure before doing partial assignments.
  
  Sponsored by:	Rubicon Communications, LLC (Netgate)

Modified:
  stable/11/sbin/etherswitchcfg/etherswitchcfg.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sbin/etherswitchcfg/etherswitchcfg.c
==============================================================================
--- stable/11/sbin/etherswitchcfg/etherswitchcfg.c	Sun Nov 20 16:16:55 2016	(r308890)
+++ stable/11/sbin/etherswitchcfg/etherswitchcfg.c	Sun Nov 20 17:03:52 2016	(r308891)
@@ -274,7 +274,8 @@ set_vlangroup_vid(struct cfg *cfg, char 
 {
 	int v;
 	etherswitch_vlangroup_t vg;
-	
+
+	memset(&vg, 0, sizeof(vg));
 	v = strtol(argv[1], NULL, 0);
 	if (v < 0 || v > IEEE802DOT1Q_VID_MAX)
 		errx(EX_USAGE, "vlan must be between 0 and %d", IEEE802DOT1Q_VID_MAX);
@@ -293,8 +294,9 @@ set_vlangroup_members(struct cfg *cfg, c
 	int member, untagged;
 	char *c, *d;
 	int v;
-	
+
 	member = untagged = 0;
+	memset(&vg, 0, sizeof(vg));
 	if (strcmp(argv[1], "none") != 0) {
 		for (c=argv[1]; *c; c=d) {
 			v = strtol(c, &d, 0);


More information about the svn-src-all mailing list