segfault in current svn
Guus Sliepen
guus at tinc-vpn.org
Wed Apr 6 22:46:34 CEST 2005
On Thu, Mar 31, 2005 at 01:09:01AM +0200, Markus Barenhoff wrote:
> the current version of tinc crashes with a segfault. it seems, as if has
> to to with fact, that i don`t have configured any subnets....
>
> if the client tries to start up subnet_update() ist called for myself.
> the for iteration does not get an entry (because the subnet avl-tree is
> empty).
>
> the later call of net2str causes a segfault, because it gets an empty
> subnet and tries to access the type field of the subnet structure.
>
> i included a patch wich checks the subnet pointer before calling the
> net2str function, and a small check inside the net2str function which
> checks the giben subnet argument against NULL (and so makes use of the
> return value :) )
Thanks! I added the check to net2str(). However instead of
> - net2str(netstr, sizeof netstr, subnet);
> + if(subnet)
> + net2str(netstr, sizeof netstr, subnet);
I removed that net2str() call entirely, because it isn't used. I guess I
forgot to remove it and it obviously didn't segfault in my case. Thanks
for noticing and sending a patch!
--
Met vriendelijke groet / with kind regards,
Guus Sliepen <guus at sliepen.eu.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://brouwer.uvt.nl/pipermail/tinc/attachments/20050406/c034818f/attachment.pgp
More information about the tinc
mailing list