]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix potential (but not actual) buffer overflow risk.
authorGuy Harris <[email protected]>
Wed, 31 Jul 2013 18:33:15 +0000 (11:33 -0700)
committerGuy Harris <[email protected]>
Wed, 31 Jul 2013 18:33:15 +0000 (11:33 -0700)
The line buffer is 256 bytes long, so the name subfield in the line
can't be bigger than 256 bytes, but

1) somebody could make the line buffer bigger

and

2) this way the format item and buffer size match

so we'll do it anyway.

print-atalk.c

index 2b7b7686e9447a66c0def7d06d1b082a9a3f8d6f..a075b189e5f14f03e506e7135047fc1eb7d9e080 100644 (file)
@@ -540,7 +540,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[256+1];
        static int first = 1;
        FILE *fp;