Handle the "no local address" case in send_sptps_data().
authorEtienne Dechamps <etienne@edechamps.fr>
Sat, 12 Jul 2014 10:06:36 +0000 (11:06 +0100)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 12 Jul 2014 12:17:59 +0000 (14:17 +0200)
commit77e96c07912c2a8b280d3e812c71fa1f12efb0ff
tree3d813dfcb90bceaf9cd274d397a4d64f70981559
parent45a30f71572fab8e73c456737b7506b2cf12be25
Handle the "no local address" case in send_sptps_data().

If choose_local_address() is unable to find a local address (e.g.
because of old nodes that don't send their local address information),
then send_sptps_data() ends up using uninitialized variables for the
socket and address.

This regression was introduced in
415910897122da0073a862784d148802ca390020. The commit took care of
handling that case in send_udppacket() but was missing the same fix
for send_sptps_data().

This bug was found by the clang static analyzer tool:
http://clang-analyzer.llvm.org/
src/net_packet.c