diff --git a/sharkd_session.c b/sharkd_session.c index 3c88feba80..6ffbc13702 100644 --- a/sharkd_session.c +++ b/sharkd_session.c @@ -4839,6 +4839,12 @@ sharkd_session_process(char *buf, const jsmntok_t *tokens, int count) const char* tok_method = json_find_attr(buf, tokens, count, "method"); + if (!tok_method) { + sharkd_json_error( + rpcid, -32601, NULL, + "No method found"); + return; + } if (!strcmp(tok_method, "load")) sharkd_session_process_load(buf, tokens, count); else if (!strcmp(tok_method, "status"))