diff --git a/channeld/channel.c b/channeld/channel.c index b4c061d34..42fb62d8f 100644 --- a/channeld/channel.c +++ b/channeld/channel.c @@ -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)); }