From ce421fa092af468fd6c4a341f1037dedc63b2cbd Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 19 Nov 2019 15:00:28 +1030 Subject: [PATCH] gossipd: don't crash if we have > 7000 stale short_channel_ids. Fixes: #3269 Signed-off-by: Rusty Russell --- gossipd/seeker.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gossipd/seeker.c b/gossipd/seeker.c index 24e5cf5fe014..6655d8d646e8 100644 --- a/gossipd/seeker.c +++ b/gossipd/seeker.c @@ -358,6 +358,8 @@ static struct short_channel_id *stale_scids_remove(const tal_t *ctx, uintmap_del(&seeker->stale_scids, scid); tal_free(qf); i++; + if (i == max) + break; } tal_resize(&scids, i); tal_resize(query_flags, i);