@@ -60,6 +60,9 @@ doAccountOffers(RPC::JsonContext& context)
6060 if (!params.isMember (jss::account))
6161 return RPC::missing_field_error (jss::account);
6262
63+ if (!params[jss::account].isString ())
64+ return RPC::invalid_field_error (jss::account);
65+
6366 std::shared_ptr<ReadView const > ledger;
6467 auto result = RPC::lookupLedger (ledger, context);
6568 if (!ledger)
@@ -84,7 +87,7 @@ doAccountOffers(RPC::JsonContext& context)
8487 return *err;
8588
8689 if (limit == 0 )
87- return rpcError (rpcINVALID_PARAMS );
90+ return RPC::invalid_field_error (jss::limit );
8891
8992 Json::Value& jsonOffers (result[jss::offers] = Json::arrayValue);
9093 std::vector<std::shared_ptr<SLE const >> offers;
@@ -101,21 +104,21 @@ doAccountOffers(RPC::JsonContext& context)
101104 std::stringstream marker (params[jss::marker].asString ());
102105 std::string value;
103106 if (!std::getline (marker, value, ' ,' ))
104- return rpcError (rpcINVALID_PARAMS );
107+ return RPC::invalid_field_error (jss::marker );
105108
106109 if (!startAfter.parseHex (value))
107- return rpcError (rpcINVALID_PARAMS );
110+ return RPC::invalid_field_error (jss::marker );
108111
109112 if (!std::getline (marker, value, ' ,' ))
110- return rpcError (rpcINVALID_PARAMS );
113+ return RPC::invalid_field_error (jss::marker );
111114
112115 try
113116 {
114117 startHint = boost::lexical_cast<std::uint64_t >(value);
115118 }
116119 catch (boost::bad_lexical_cast&)
117120 {
118- return rpcError (rpcINVALID_PARAMS );
121+ return RPC::invalid_field_error (jss::marker );
119122 }
120123
121124 // We then must check if the object pointed to by the marker is actually
0 commit comments