mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-29 03:44:30 +01:00
bitcoin: use a length arg to bitcoin_tx_from_hex
Our json parser doesn't use nul-terminated strings. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -13,7 +13,7 @@ struct bitcoin_tx *bitcoin_tx_from_file(const tal_t *ctx, const char *filename)
|
||||
if (!hex)
|
||||
err(1, "Opening %s", filename);
|
||||
|
||||
tx = bitcoin_tx_from_hex(ctx, hex);
|
||||
tx = bitcoin_tx_from_hex(ctx, hex, strlen(hex));
|
||||
if (!tx)
|
||||
err(1, "Failed to decode tx '%s'", hex);
|
||||
tal_free(hex);
|
||||
|
||||
Reference in New Issue
Block a user