From 60b43c45a204a6c0651e8017e1e505015ba74094 Mon Sep 17 00:00:00 2001 From: Dan McDonald Date: Sun, 18 May 2014 21:18:36 -0400 Subject: [PATCH] 4868 ifconfig(1M)'s "addif" uses an uninitialized mask if not specified Reviewed by: Robert Mustacchi Reviewed by: Andy Stormont Reviewed by: Josef 'Jeff' Sipek Approved by: Garrett D'Amore --- usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c b/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c index 4fb78375f7..299bb4740d 100644 --- a/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c +++ b/usr/src/cmd/cmd-inet/usr.sbin/ifconfig/ifconfig.c @@ -1,8 +1,7 @@ /* - * Copyright 2012, Daniil Lunev. All rights reserved. - */ -/* * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2012, Daniil Lunev. All rights reserved. + * Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved. */ /* * Copyright (c) 1983 Regents of the University of California. @@ -1836,6 +1835,9 @@ addif(char *str, int64_t param) setaddr = 0; (*afp->af_getaddr)(str, (struct sockaddr *)&laddr, &prefixlen); + (void) memset(&mask, 0, sizeof (mask)); + mask.ss_family = afp->af_af; + switch (prefixlen) { case NO_PREFIX: /* Nothing there - ok */ -- 2.11.4.GIT