mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
psbt: handle 'NULL' or empty byte PSBTs
Don't crash if the PSBT is null / zero-byte len.
This commit is contained in:
@@ -742,7 +742,7 @@ struct wally_psbt *fromwire_wally_psbt(const tal_t *ctx,
|
|||||||
|
|
||||||
psbt_byte_len = fromwire_u32(cursor, max);
|
psbt_byte_len = fromwire_u32(cursor, max);
|
||||||
psbt_buf = fromwire(cursor, max, NULL, psbt_byte_len);
|
psbt_buf = fromwire(cursor, max, NULL, psbt_byte_len);
|
||||||
if (!psbt_buf)
|
if (!psbt_buf || psbt_byte_len == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
psbt = psbt_from_bytes(ctx, psbt_buf, psbt_byte_len);
|
psbt = psbt_from_bytes(ctx, psbt_buf, psbt_byte_len);
|
||||||
|
|||||||
Reference in New Issue
Block a user