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/print-atalk.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/print-atalk.c')
-rw-r--r-- | contrib/tcpdump/print-atalk.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/tcpdump/print-atalk.c b/contrib/tcpdump/print-atalk.c index 869881f..2b77ecd 100644 --- a/contrib/tcpdump/print-atalk.c +++ b/contrib/tcpdump/print-atalk.c @@ -500,7 +500,7 @@ ataddr_string(u_short atnet, u_char athost) { register struct hnamemem *tp, *tp2; register int i = (atnet << 8) | athost; - char nambuf[256]; + char nambuf[MAXHOSTNAMELEN + 20]; static int first = 1; FILE *fp; @@ -545,7 +545,7 @@ ataddr_string(u_short atnet, u_char athost) if (tp2->addr == i) { tp->addr = (atnet << 8) | athost; tp->nxt = newhnamemem(); - (void)sprintf(nambuf, "%s.%d", tp2->name, athost); + (void)snprintf(nambuf, sizeof(nambuf), "%s.%d", tp2->name, athost); tp->name = savestr(nambuf); return (tp->name); } |