mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Improve validation of JSON inputs
This commit is contained in:
@@ -383,8 +383,12 @@ bool STParsedJSON::parse (std::string const& json_name,
|
||||
|
||||
try
|
||||
{
|
||||
data.push_back (new STVariableLength (field,
|
||||
strUnHex (value.asString ())));
|
||||
std::pair<Blob, bool> ret(strUnHex (value.asString ()));
|
||||
|
||||
if (!ret.second)
|
||||
throw std::invalid_argument ("invalid data");
|
||||
|
||||
data.push_back (new STVariableLength (field, ret.first));
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user