Date: Sun, 27 Mar 2016 20:02:21 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297321 - head/usr.bin/netstat Message-ID: <201603272002.u2RK2LrG060126@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Sun Mar 27 20:02:21 2016 New Revision: 297321 URL: https://svnweb.freebsd.org/changeset/base/297321 Log: netstat: avoid returning uninitialized value in p_sockaddr(). In the case the width is less than 0, we are returning an uninitialized value. For practical purposes the return value is ignored but initialize it to avoid trouble. CID: 1341619 Modified: head/usr.bin/netstat/route.c Modified: head/usr.bin/netstat/route.c ============================================================================== --- head/usr.bin/netstat/route.c Sun Mar 27 19:43:26 2016 (r297320) +++ head/usr.bin/netstat/route.c Sun Mar 27 20:02:21 2016 (r297321) @@ -417,6 +417,7 @@ p_sockaddr(const char *name, struct sock if (width < 0) { snprintf(buf, sizeof(buf), "{:%s/%%s} ", name); xo_emit(buf, cp); + protrusion = 0; } else { if (Wflag != 0 || numeric_addr) { snprintf(buf, sizeof(buf), "{[:%d}{:%s/%%s}{]:} ",
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201603272002.u2RK2LrG060126>