ipaddr_to_string: SECURITY: Do not allocate
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 19 Sep 2014 22:35:06 +0000 (23:35 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 19 Sep 2014 22:35:06 +0000 (23:35 +0100)
commit5540bab74ca1a39639a098d15e87daf45d83b7ec
tree5d57ccc53f39579b5d98653896f28925d520f6cb
parent1b4ca45e628241eb21bd6f8fbc5ba3c647454db4
ipaddr_to_string: SECURITY: Do not allocate

ipaddr_to_string is used in many places including runtime logging.
Handling its memory allocation is annoyingly fiddly.  Indeed there is
at least one possible memory leak, which represents a potential denial
of service bug.

None of the callers keep the answers for any length of time.

So make it return the next one of a series of round-robin buffers,
instead, and remove all the freeing at all the call sites.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
ipaddr.c
netlink.c
tun.c