diff --git a/bitcoin/script.c b/bitcoin/script.c index 40a7ac6aa..3a84ce0ca 100644 --- a/bitcoin/script.c +++ b/bitcoin/script.c @@ -7,6 +7,7 @@ #include #include #include +#include /* Some standard ops */ #define OP_PUSHBYTES(val) (val) @@ -76,7 +77,7 @@ static void add_push_bytes(u8 **scriptp, const void *mem, size_t len) add(scriptp, &v, 4); } - add(scriptp, mem, len); + add(scriptp, memcheck(mem, len), len); } static void add_number(u8 **script, u32 num) diff --git a/daemon/packets.c b/daemon/packets.c index ca935bcac..b47235c67 100644 --- a/daemon/packets.c +++ b/daemon/packets.c @@ -469,9 +469,12 @@ Pkt *accept_pkt_htlc_update(const tal_t *ctx, peer_get_revocation_hash(peer, peer->num_htlcs+1, &cur->our_revocation_hash); + memcheck(&cur->their_revocation_hash, sizeof(cur->their_revocation_hash)); /* Now we create the commit tx pair. */ - make_commit_txs(cur, peer, &cur->our_revocation_hash, + make_commit_txs(cur, peer, + memcheck(&cur->our_revocation_hash, + sizeof(cur->our_revocation_hash)), &cur->their_revocation_hash, cur->cstate, &cur->our_commit, &cur->their_commit); diff --git a/funding.c b/funding.c index fc2fd08f5..927bb9fd6 100644 --- a/funding.c +++ b/funding.c @@ -1,5 +1,6 @@ #include "funding.h" #include +#include #include #include @@ -188,6 +189,9 @@ void funding_add_htlc(struct channel_oneside *creator, creator->htlcs[n].msatoshis = msatoshis; creator->htlcs[n].expiry = *expiry; creator->htlcs[n].rhash = *rhash; + memcheck(&creator->htlcs[n].msatoshis, + sizeof(creator->htlcs[n].msatoshis)); + memcheck(&creator->htlcs[n].rhash, sizeof(creator->htlcs[n].rhash)); } size_t funding_find_htlc(struct channel_oneside *creator,