Suspicious code in net_socket.c

Guus Sliepen guus at tinc-vpn.org
Tue Mar 7 19:23:44 CET 2017


On Mon, Mar 06, 2017 at 01:00:45PM +0300, Roman S wrote:

> Module - net_socket.c
> Function - get_known_addresses
> ---------------------------------------------------
> struct addrinfo *nai = xzalloc(sizeof *nai);
> if(ai)
>       ai->ai_next = nai;
> ai = nai;
> --------------------------------------------------
> For my opinion, possible causes:
> 1. Lost trails (ai_next)
> 2. ai_next not initialized 
> 3. Possible segfault during "freeaddrinfo" call in do_outgoing_connections

You are right about 1 and 3. I applied your patch, which fixes 1, and I
added a free_known_addresses() function to clean up the struct addrinfo
chain that we built ourselves. Please check out the latest version of
the 1.1 branch in git and check if it works for you.

-- 
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: 819 bytes
Desc: Digital signature
URL: <http://www.tinc-vpn.org/pipermail/tinc-devel/attachments/20170307/1b823626/attachment.sig>


More information about the tinc-devel mailing list