diff options
author | melifaro <melifaro@FreeBSD.org> | 2014-01-07 15:59:33 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2014-01-07 15:59:33 +0000 |
commit | 860ae05c247eb5df91c298455651409654d1112c (patch) | |
tree | efc014a0ef02ce8ce0cdc44797ad3f3207a73316 /sys/net/if_tun.c | |
parent | 23d2536d967b362900ad5c5d582ca7546a35e7a5 (diff) | |
download | FreeBSD-src-860ae05c247eb5df91c298455651409654d1112c.zip FreeBSD-src-860ae05c247eb5df91c298455651409654d1112c.tar.gz |
Teach every SIOCGIFSTATUS provider to fill in ifs->ascii anyway.
Remove old bits of data concat for 'ascii' field.
Remove special SIOCGIFSTATUS handling from if.c (which Coverity yells at).
Reported by: Coverity
Coverity CID: 1147174
MFC after: 2 weeks
Diffstat (limited to 'sys/net/if_tun.c')
-rw-r--r-- | sys/net/if_tun.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c index ddef6f9..45e10c1 100644 --- a/sys/net/if_tun.c +++ b/sys/net/if_tun.c @@ -546,8 +546,10 @@ tunifioctl(struct ifnet *ifp, u_long cmd, caddr_t data) ifs = (struct ifstat *)data; mtx_lock(&tp->tun_mtx); if (tp->tun_pid) - sprintf(ifs->ascii + strlen(ifs->ascii), + snprintf(ifs->ascii, sizeof(ifs->ascii), "\tOpened by PID %d\n", tp->tun_pid); + else + ifs->ascii[0] = '\0'; mtx_unlock(&tp->tun_mtx); break; case SIOCSIFADDR: |