Skip to content

Commit

Permalink
Correct addkey for missing parameter count guard for sidestakes
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescowens committed Dec 30, 2023
1 parent 3c7df9d commit 91a9a76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2485,7 +2485,7 @@ UniValue addkey(const UniValue& params, bool fHelp)
// We have to do our own conversion here because the 4th parameter type specifier cannot be set other
// than string in the client.cpp file.
double allocation = 0.0;
if (!ParseDouble(params[3].get_str(), &allocation)) {
if (params.size() > 3 && !ParseDouble(params[3].get_str(), &allocation)) {
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid allocation specified.");
}

Expand Down

0 comments on commit 91a9a76

Please sign in to comment.