From 024a12e75bea8695a02e2abb43eb0d77cb04f144 Mon Sep 17 00:00:00 2001
From: Andre Noll <maan@systemlinux.org>
Date: Sat, 15 Sep 2007 22:09:31 +0200
Subject: [PATCH] command.c: Fix a bug in get_cmd_ptr().

Caused handler to segfault if an invalid command was given.
---
 command.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
-- 
2.39.5