From: Andre Noll Date: Sat, 15 Sep 2007 20:09:31 +0000 (+0200) Subject: command.c: Fix a bug in get_cmd_ptr(). X-Git-Tag: v0.3.0~399 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=024a12e75bea8695a02e2abb43eb0d77cb04f144;p=paraslash.git command.c: Fix a bug in get_cmd_ptr(). Caused handler to segfault if an invalid command was given. --- diff --git a/command.c b/command.c index 516a62fe..212a1800 100644 --- a/command.c +++ b/command.c @@ -473,7 +473,7 @@ static struct server_command *get_cmd_ptr(const char *name, char **handler) if (!strcmp(cmd->name, name)) return cmd; /* not found, look for commands supported by afs */ - for (cmd = afs_cmds; cmd; cmd++) + for (cmd = afs_cmds; cmd->name; cmd++) if (!strcmp(cmd->name, name)) return cmd; return NULL;