sharkd: prevent a NULL pointer dereference (CID 1486264)

This commit is contained in:
Pascal Quantin 2021-06-22 16:59:03 +02:00
parent d317382464
commit 16f5269d54
1 changed files with 6 additions and 0 deletions

View File

@ -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"))