tinc 1.1: freeaddrinfo(NULL) crash on windows

Guus Sliepen guus at tinc-vpn.org
Wed Feb 21 20:02:26 CET 2018


On Tue, Feb 20, 2018 at 08:26:24PM -0700, Todd C. Miller wrote:

> Unfortunately, my fix exposed a problem in reset_address_cache()
> could call free_known_addresses() on a struct addrinfo * that was
> returned by getaddrinfo().  This results in heap corruption on
> Windows (and a crash).
> 
> It seems safest to just make a copy of the addresses returned by
> getaddrinfo() so it can always use free_known_addresses() instead
> of trying to determine whether or not we need to use freeaddrinfo().

Neither the old code nor the new version wins any prizes for beauty, but
if the old code crashed then it should be replaced. It's not so nice
that we're copying things that should be unnecessary; on the other hand,
now that we have a cache we will likely not have to do lookups often
anyway.

-- 
Met vriendelijke groet / with kind regards,
     Guus Sliepen <guus at tinc-vpn.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://www.tinc-vpn.org/pipermail/tinc-devel/attachments/20180221/d0ff16a5/attachment.sig>


More information about the tinc-devel mailing list