diff options
author | kris <kris@FreeBSD.org> | 2000-10-05 02:49:49 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2000-10-05 02:49:49 +0000 |
commit | 0e6572e8c926177cef3761baf9d239b9e9fcd284 (patch) | |
tree | 272e6ba0729da219ce1b5874a9a588104608fee5 /contrib/tcpdump/addrtoname.c | |
parent | 7790e4029528c008ed9548e6cd9cbc55f6d22c61 (diff) | |
download | FreeBSD-src-0e6572e8c926177cef3761baf9d239b9e9fcd284.zip FreeBSD-src-0e6572e8c926177cef3761baf9d239b9e9fcd284.tar.gz |
* Buffer-safe string function cleanup. There are a couple of strcpy()
and strcat()s which would be more difficult to fix, but I think they're
safe anyway.
* Don't crash at runtime by overflowing a buffer with constant data in
print-icmp.c on a long hostname.
* Don't overflow a static buffer by trying to decode an AFS ACL into a buffer
which is way too small for it.
Reviewed by: -audit
Diffstat (limited to 'contrib/tcpdump/addrtoname.c')
-rw-r--r-- | contrib/tcpdump/addrtoname.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/tcpdump/addrtoname.c b/contrib/tcpdump/addrtoname.c index 99134e9..c1f2208 100644 --- a/contrib/tcpdump/addrtoname.c +++ b/contrib/tcpdump/addrtoname.c @@ -559,7 +559,7 @@ tcpport_string(u_short port) tp->addr = i; tp->nxt = newhnamemem(); - (void)sprintf(buf, "%u", i); + (void)snprintf(buf, sizeof(buf), "%u", i); tp->name = savestr(buf); return (tp->name); } @@ -578,7 +578,7 @@ udpport_string(register u_short port) tp->addr = i; tp->nxt = newhnamemem(); - (void)sprintf(buf, "%u", i); + (void)snprintf(buf, sizeof(buf), "%u", i); tp->name = savestr(buf); return (tp->name); } @@ -604,7 +604,7 @@ init_servarray(void) while (table->name) table = table->nxt; if (nflag) { - (void)sprintf(buf, "%d", port); + (void)snprintf(buf, sizeof(buf), "%d", port); table->name = savestr(buf); } else table->name = savestr(sv->s_name); |