Skip to content

Commit

Permalink
common: fix uninitialized member in gossmap.
Browse files Browse the repository at this point in the history
Wrote a test program which passed num_channel_updates_rejected as NULL
(which we don't usually do), and valgrind complained:

```
==1048302== Conditional jump or move depends on uninitialised value(s)
==1048302==    at 0x118B90: update_channel (gossmap.c:550)
==1048302==    by 0x119EEE: map_catchup (gossmap.c:663)
==1048302==    by 0x11A299: load_gossip_store (gossmap.c:726)
==1048302==    by 0x11A352: gossmap_load (gossmap.c:1052)
==1048302==    by 0x125362: main (run-route-infloop.c:90)
```

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Mar 7, 2024
1 parent d1101f4 commit 0a7e621
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/gossmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,8 @@ struct gossmap *gossmap_load(const tal_t *ctx, const char *filename,
*num_channel_updates_rejected = 0;
map->cupdate_fail = cupdate_fail_inc_ctr;
map->cb_arg = num_channel_updates_rejected;
}
} else
map->cupdate_fail = NULL;
map->unknown_record = NULL;

if (!load_gossip_store(map))
Expand Down

0 comments on commit 0a7e621

Please sign in to comment.