mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-02-21 22:31:48 +01:00
plugin: add check on the type json object during the IO message handling
This commit is contained in:
parent
d284b98911
commit
b624c53051
1 changed files with 5 additions and 0 deletions
|
@ -643,6 +643,11 @@ static const char *plugin_read_json_one(struct plugin *plugin,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (plugin->toks->type != JSMN_OBJECT)
|
||||
return tal_fmt(
|
||||
plugin,
|
||||
"JSON-RPC message is not a valid JSON object type");
|
||||
|
||||
jrtok = json_get_member(plugin->buffer, plugin->toks, "jsonrpc");
|
||||
idtok = json_get_member(plugin->buffer, plugin->toks, "id");
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue