netstat: use a statically defined buffer for the (AF_UNIX) null address
commitabe082d33f51a0ae2fa62f6e5cb33a9ad6ce5052
authorJosef 'Jeff' Sipek <jeffpc@josefsipek.net>
Sat, 1 Jul 2017 08:29:12 +0000 (1 11:29 +0300)
committerJosef 'Jeff' Sipek <jeffpc@josefsipek.net>
Sat, 1 Jul 2017 08:29:12 +0000 (1 11:29 +0300)
tree8c3cc9d4b9b433dabd26b038aaaf0e65a70877d4
parent992a5c4c81210a12300994f63fac050902cc0c91
netstat: use a statically defined buffer for the (AF_UNIX) null address

There were two issues with the heap-based code:

 (1) the string wasn't being \0 terminated
 (2) the memory was never freed

While the second problem is not that bad, the first could be quite annoying.
usr/src/cmd/cmd-inet/usr.bin/netstat/unix.c