channeld: correctly send failure message on local HTLC failure.

valgrind was complaining about uninitialized bytes over the wire.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-08-30 10:50:48 +09:30
committed by Christian Decker
parent 9da5abc39c
commit 52db7fd27b

View File

@@ -1759,6 +1759,8 @@ static void handle_offer_htlc(struct peer *peer, const u8 *inmsg)
abort();
failed:
/* Note: tal_fmt doesn't set tal_len() to exact length, so fix here. */
tal_resize(&failmsg, strlen(failmsg)+1);
msg = towire_channel_offer_htlc_reply(inmsg, 0, failcode, (u8*)failmsg);
daemon_conn_send(&peer->master, take(msg));
}