summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-03-27 20:02:21 +0000
committerpfg <pfg@FreeBSD.org>2016-03-27 20:02:21 +0000
commita7966dbd97f2c648ecbe826bdf4042b26fb6a0e0 (patch)
treee6983595513f3ad00609938082fc4c50d3b50d5c /usr.bin
parent81a16edc2fd803c1ceaedc37f41ac8a6b01f7bf0 (diff)
downloadFreeBSD-src-a7966dbd97f2c648ecbe826bdf4042b26fb6a0e0.zip
FreeBSD-src-a7966dbd97f2c648ecbe826bdf4042b26fb6a0e0.tar.gz
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
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/netstat/route.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/netstat/route.c b/usr.bin/netstat/route.c
index 77487df..1cd831b 100644
--- a/usr.bin/netstat/route.c
+++ b/usr.bin/netstat/route.c
@@ -417,6 +417,7 @@ p_sockaddr(const char *name, struct sockaddr *sa, struct sockaddr *mask,
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}{]:} ",
OpenPOWER on IntegriCloud