Skip to content

Commit a272258

Browse files
Lagrang3endothermicdev
authored andcommitted
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 b78b323 commit a272258

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
@@ -1938,6 +1938,12 @@ static struct command_result *handle_rpc_command(struct command *cmd,
19381938
bolt11 = params_tok + 1;
19391939
if (params_tok->size == 2)
19401940
amount_msat = json_next(bolt11);
1941+
1942+
/* some arguments could have null values in the list */
1943+
if (bolt11 && json_tok_is_null(buf, bolt11))
1944+
bolt11 = NULL;
1945+
if (amount_msat && json_tok_is_null(buf, amount_msat))
1946+
amount_msat = NULL;
19411947
} else if (params_tok->type == JSMN_OBJECT) {
19421948
const jsmntok_t *t, *maxfeepercent = NULL, *exemptfee = NULL;
19431949
size_t i;

0 commit comments

Comments
 (0)