mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-23 17:14:22 +01:00
json: Add two param functions to parse string arrs and outpoint arrs
In a couple of places we accept arrays of strings and don't validate them. If we forward them, e.g., call a JSON-RPC method from the plugin, we end up embedding the unverified string in the JSON-RPC call without escaping, which then leads to invalid JSON being passed on. This at least partially causes #4238
This commit is contained in:
committed by
Rusty Russell
parent
eacc54646f
commit
32000b6660
@@ -11,6 +11,7 @@
|
||||
struct amount_msat;
|
||||
struct amount_sat;
|
||||
struct bitcoin_txid;
|
||||
struct bitcoin_outpoint;
|
||||
struct channel_id;
|
||||
struct command;
|
||||
struct command_result;
|
||||
@@ -172,4 +173,13 @@ struct command_result *param_psbt(struct command *cmd,
|
||||
const char *buffer,
|
||||
const jsmntok_t *tok,
|
||||
struct wally_psbt **psbt);
|
||||
|
||||
/**
|
||||
* Parse a list of `txid:output` outpoints.
|
||||
*/
|
||||
struct command_result *param_outpoint_arr(struct command *cmd,
|
||||
const char *name,
|
||||
const char *buffer,
|
||||
const jsmntok_t *tok,
|
||||
struct bitcoin_outpoint **outpoints);
|
||||
#endif /* LIGHTNING_COMMON_JSON_TOK_H */
|
||||
|
||||
Reference in New Issue
Block a user