From d2265cd3d2f2489848cbaa75b88c693a37dd5282 Mon Sep 17 00:00:00 2001 From: practicalswift Date: Tue, 20 Feb 2018 12:49:40 +0100 Subject: [PATCH] Make sure msatoshi and sender are not uninitialized when calling channel_add_htlc(...) --- channeld/test/run-full_channel.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/channeld/test/run-full_channel.c b/channeld/test/run-full_channel.c index e9ca5a8cb..576be72ac 100644 --- a/channeld/test/run-full_channel.c +++ b/channeld/test/run-full_channel.c @@ -117,7 +117,7 @@ static const struct htlc **include_htlcs(struct channel *channel, enum side side struct sha256 hash; enum channel_add_err e; enum side sender; - u64 msatoshi; + u64 msatoshi = 0; switch (i) { case 0: @@ -141,6 +141,8 @@ static const struct htlc **include_htlcs(struct channel *channel, enum side side msatoshi = 4000000; break; } + assert(msatoshi != 0); + memset(&preimage, i, sizeof(preimage)); sha256(&hash, &preimage, sizeof(preimage)); e = channel_add_htlc(channel, sender, i, msatoshi, 500+i, &hash,