Skip to content

Commit

Permalink
Client names of new clients may be invalid strings. Test against NULL…
Browse files Browse the repository at this point in the history
… before passing to strcmp(). Fixes #328

Signed-off-by: DL6ER <dl6er@dl6er.de>
  • Loading branch information
DL6ER authored and AzureMarker committed Jul 25, 2018
1 parent f517961 commit dc87186
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api.c
Expand Up @@ -687,8 +687,9 @@ void getAllQueries(char *client_message, int *sock)
if(filterclientname)
{
// Skip if client name and IP are not identical with what the user wants to see
if(strcmp(clients[queries[i].clientID].ip, clientname) != 0 &&
strcmp(clients[queries[i].clientID].name, clientname) != 0)
if(strcmp(clients[queries[i].clientID].ip, clientname) != 0 &&
(clients[queries[i].clientID].name != NULL &&
strcmp(clients[queries[i].clientID].name, clientname) != 0))
continue;
}

Expand Down

0 comments on commit dc87186

Please sign in to comment.