mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
This commit is contained in:
parent
2f396d3cc3
commit
cfe3da09e2
1 changed files with 1 additions and 0 deletions
|
|
@ -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}{]:} ",
|
||||
|
|
|
|||
Loading…
Reference in a new issue