mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-19 21:14:38 +01:00
plugin: add check on the type json object during the IO message handling
This commit is contained in:
committed by
neil saitug
parent
d284b98911
commit
b624c53051
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user