mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Stricter checking on integer json inputs.
This commit is contained in:
committed by
Nik Bougalis
parent
b509263ef5
commit
e5bf824c3b
@@ -57,7 +57,7 @@ Json::Value doLedgerRequest (RPC::Context& context)
|
||||
else
|
||||
{
|
||||
auto const& jsonIndex = context.params[jss::ledger_index];
|
||||
if (!jsonIndex.isNumeric ())
|
||||
if (!jsonIndex.isInt())
|
||||
return RPC::invalid_field_error (jss::ledger_index);
|
||||
|
||||
// We need a validated ledger to get the hash from the sequence
|
||||
|
||||
@@ -640,19 +640,19 @@ Json::Value checkFee (
|
||||
int div = Tuning::defaultAutoFillFeeDivisor;
|
||||
if (request.isMember (jss::fee_mult_max))
|
||||
{
|
||||
if (request[jss::fee_mult_max].isNumeric ())
|
||||
if (request[jss::fee_mult_max].isInt())
|
||||
{
|
||||
mult = request[jss::fee_mult_max].asInt();
|
||||
}
|
||||
else
|
||||
{
|
||||
return RPC::make_error (rpcHIGH_FEE,
|
||||
RPC::expected_field_message (jss::fee_mult_max, "a number"));
|
||||
RPC::expected_field_message (jss::fee_mult_max, "an integer"));
|
||||
}
|
||||
}
|
||||
if (request.isMember(jss::fee_div_max))
|
||||
{
|
||||
if (request[jss::fee_div_max].isNumeric())
|
||||
if (request[jss::fee_div_max].isInt())
|
||||
{
|
||||
div = request[jss::fee_div_max].asInt();
|
||||
if (div == 0)
|
||||
@@ -662,7 +662,7 @@ Json::Value checkFee (
|
||||
else
|
||||
{
|
||||
return RPC::make_error(rpcHIGH_FEE,
|
||||
RPC::expected_field_message(jss::fee_div_max, "a number"));
|
||||
RPC::expected_field_message(jss::fee_div_max, "an integer"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -222,8 +222,8 @@ R"({
|
||||
}
|
||||
})",
|
||||
{
|
||||
"Invalid field 'fee_mult_max', not a number.",
|
||||
"Invalid field 'fee_mult_max', not a number.",
|
||||
"Invalid field 'fee_mult_max', not an integer.",
|
||||
"Invalid field 'fee_mult_max', not an integer.",
|
||||
"Missing field 'tx_json.Fee'.",
|
||||
"Missing field 'tx_json.SigningPubKey'."}},
|
||||
|
||||
@@ -243,8 +243,8 @@ R"({
|
||||
}
|
||||
})",
|
||||
{
|
||||
"Invalid field 'fee_div_max', not a number.",
|
||||
"Invalid field 'fee_div_max', not a number.",
|
||||
"Invalid field 'fee_div_max', not an integer.",
|
||||
"Invalid field 'fee_div_max', not an integer.",
|
||||
"Missing field 'tx_json.Fee'.",
|
||||
"Missing field 'tx_json.SigningPubKey'."}},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user