Fix a use-after-free bug in get_recent_address() and two related issues.
authorTodd C. Miller <Todd.Miller@sudo.ws>
Fri, 16 Feb 2018 21:17:39 +0000 (14:17 -0700)
committerTodd C. Miller <Todd.Miller@sudo.ws>
Fri, 16 Feb 2018 21:17:39 +0000 (14:17 -0700)
1) The sockaddr_t * returned may be part of memory freed by the call to
   freeaddrinfo().
2) The sockaddr_t * returned from a recently seen address not in the
   cache was cast from struct addrinfo *ai, not the struct sockaddr *
   inside of it.
3) In do_outgoing_connection(), when filling in the address in the
   connection_t, there is a buffer overflow (read, not write) if
   the sa returned by get_recent_address() didn't come from the
   cache of recently seen addresses.  That is, it was really a
   struct sockaddr * and not a sockaddr_t *.  This last was
   found by building tinc with address sanitizer.


No differences found