Skip to content

Commit

Permalink
Fix possible invalid read in channel completion system (following to …
Browse files Browse the repository at this point in the history
…commit 23e87ca)
  • Loading branch information
Levak committed Oct 5, 2016
1 parent e48c2d4 commit b89a80b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmd/complete.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ static void copy_channel_pve_name(struct masterserver *m, void *args)
{
struct list *l = (struct list *) args;

if (m->resource == NULL || NULL != strstr(m->channel, "pve"))
if (m->resource != NULL && NULL != strstr(m->channel, "pve"))
list_add(l, strdup(m->resource));
}

static void copy_channel_pvp_name(struct masterserver *m, void *args)
{
struct list *l = (struct list *) args;

if (m->resource == NULL || NULL != strstr(m->channel, "pvp"))
if (m->resource != NULL && NULL != strstr(m->channel, "pvp"))
list_add(l, strdup(m->resource));
}

Expand Down

0 comments on commit b89a80b

Please sign in to comment.