mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
Add assertions in various places to ensure tal_fmt doesn't receive NULL as argument for strings.
This commit is contained in:
committed by
Christian Decker
parent
aba3d5f34d
commit
b857b2e843
@@ -489,6 +489,7 @@ static unsigned int htlc_id_from_pkt(const Pkt *pkt)
|
||||
static Pkt *htlc_pkt(const tal_t *ctx, const char *prefix, unsigned int id)
|
||||
{
|
||||
assert(id != -1);
|
||||
assert(prefix != NULL);
|
||||
return (Pkt *)tal_fmt(ctx, "%s: HTLC #%u", prefix, id);
|
||||
}
|
||||
|
||||
@@ -501,6 +502,7 @@ static unsigned int htlc_id_from_tx(const struct bitcoin_tx *tx)
|
||||
static struct bitcoin_tx *htlc_tx(const tal_t *ctx,
|
||||
const char *prefix, unsigned int id)
|
||||
{
|
||||
assert(prefix != NULL);
|
||||
return (struct bitcoin_tx *)tal_fmt(ctx, "%s HTLC #%u", prefix, id);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user