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.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=024a12e75bea8695a02e2abb43eb0d77cb04f144;hp=74d8b443aba528dc65af874a81c53be26aaace9e 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;