mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
daemon: add memcheck() in various places where we expect things to be initialized.
This just causes valgrind to warn sooner. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
ab1176d218
commit
c1d1b360bf
@ -7,6 +7,7 @@
|
||||
#include <ccan/crypto/ripemd160/ripemd160.h>
|
||||
#include <ccan/crypto/sha256/sha256.h>
|
||||
#include <ccan/endian/endian.h>
|
||||
#include <ccan/mem/mem.h>
|
||||
|
||||
/* 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)
|
||||
|
@ -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);
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "funding.h"
|
||||
#include <assert.h>
|
||||
#include <ccan/mem/mem.h>
|
||||
#include <ccan/structeq/structeq.h>
|
||||
#include <string.h>
|
||||
|
||||
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user