From 5474512c31366c25128a31617877e3da8e9ee98b Mon Sep 17 00:00:00 2001 From: practicalswift Date: Thu, 8 Feb 2018 09:09:17 +0100 Subject: [PATCH] Add assertion to clarify assumption made in order to avoid UB --- lightningd/pay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightningd/pay.c b/lightningd/pay.c index 0ae0e2763..b817bc806 100644 --- a/lightningd/pay.c +++ b/lightningd/pay.c @@ -316,7 +316,7 @@ static void random_mark_channel_unroutable(struct log *log, size_t i; const struct short_channel_id *channel; u8 *msg; - assert(tal_len(route_channels) != 0); + assert(num_channels != 0); /* Select one channel by random. */ randombytes_buf(&i, sizeof(i));