core-lightning/gossipd
William Casarin 3f035cb3cc gossipd: fix uninitialized free on short_route in goto path
Fix a path where tal_free is called on an uninitialized variable

If the first `goto bad_total` executes, then that path has
uninitialized `short_route` but bad_total passes through to `out`
whose first call is tal_free(short_route).

This was noticed by a maybe-uninitialized heuristic on gcc 7.4.0:

gossipd/routing.c: In function ‘find_shorter_route’:
gossipd/routing.c:1096:2: error: ‘short_route’ may be used
uninitialized in this function [-Werror=maybe-uninitialized]
  tal_free(short_route);

Reported-by: @ZmnSCPxj <https://github.com/ElementsProject/lightning/pull/2674#issuecomment-495617253>
Signed-off-by: William Casarin <jb55@jb55.com>
2019-06-03 00:07:11 +00:00
..
test gossipd: free channels in routing_state destructor. 2019-05-22 11:28:44 +00:00
broadcast.c gossipd: neaten insert_broadcast a little. 2019-05-22 11:28:44 +00:00
broadcast.h gossipd: neaten insert_broadcast a little. 2019-05-22 11:28:44 +00:00
gossip_constants.h Use node_id everywhere for nodes. 2019-04-09 12:37:16 -07:00
gossip_peerd_wire.csv gossipd: send per-peer daemons offsets into gossip store. 2019-05-13 05:16:18 +00:00
gossip_store.c gossipd: use explicit destructor for struct chan. 2019-05-22 11:28:44 +00:00
gossip_store.csv gossip_store: change format so we store raw messages. 2019-05-13 05:16:18 +00:00
gossip_store.h gossipd: neaten insert_broadcast a little. 2019-05-22 11:28:44 +00:00
gossip_wire.csv gossipd: reply to large listchannels in parts. 2019-05-22 11:28:44 +00:00
gossipd.c gossipd: use explicit destructor for struct chan. 2019-05-22 11:28:44 +00:00
Makefile common: move gossip_store read routine where subdaemons can access it. 2019-05-13 05:16:18 +00:00
routing.c gossipd: fix uninitialized free on short_route in goto path 2019-06-03 00:07:11 +00:00
routing.h gossipd: use explicit destructor for struct chan. 2019-05-22 11:28:44 +00:00