common: fix uninitialized member in gossmap.

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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-03-06 13:54:21 +10:30 committed by Christian Decker
parent d1101f416f
commit 0a7e6211df

View File

@ -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))