Skip to content

Commit 9e1f00b

Browse files
committed
xpay-handle-pay: bugfix, handle null parameters
Changelog-Fixed: xpay-handle-pay: handle null parameters passed in the "param" list. Reported-by: @hMsats Signed-off-by: Lagrang3 <[email protected]>
1 parent fa10323 commit 9e1f00b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

plugins/xpay/xpay.c

+6
Original file line numberDiff line numberDiff line change
@@ -1914,6 +1914,12 @@ static struct command_result *handle_rpc_command(struct command *cmd,
19141914
bolt11 = params_tok + 1;
19151915
if (params_tok->size == 2)
19161916
amount_msat = json_next(bolt11);
1917+
1918+
/* some arguments could have null values in the list */
1919+
if (bolt11 && json_tok_is_null(buf, bolt11))
1920+
bolt11 = NULL;
1921+
if (amount_msat && json_tok_is_null(buf, amount_msat))
1922+
amount_msat = NULL;
19171923
} else if (params_tok->type == JSMN_OBJECT) {
19181924
const jsmntok_t *t, *maxfeepercent = NULL, *exemptfee = NULL;
19191925
size_t i;

0 commit comments

Comments
 (0)