]> git.tue.mpg.de Git - paraslash.git/commitdiff
command.c: Fix a bug in get_cmd_ptr().
authorAndre Noll <maan@systemlinux.org>
Sat, 15 Sep 2007 20:09:31 +0000 (22:09 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 15 Sep 2007 20:09:31 +0000 (22:09 +0200)
Caused handler to segfault if an invalid command was given.

command.c

index 516a62fe520887e1b015ff8e159b8027dd86b232..212a1800e1a32726096c3461c05ee2e9a3bacbfb 100644 (file)
--- 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;