From 62e1bafe1c5a85eab4f80b6343e7c80dfa80fbf4 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 29 May 2003 15:39:53 +0000 Subject: Don't crash when doing command name completion. Fixes debian bug #194776 (This used to be commit 45b0a63aba1c974e5e38f8f95bc158bc30a05a3b) --- source3/client/client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/client/client.c b/source3/client/client.c index 690cc99f7f..918b435b2d 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -2328,9 +2328,11 @@ static char **completion_fn(const char *text, int start, int end) if (sp == NULL) return NULL; - for (i = 0; commands[i].name; i++) + for (i = 0; commands[i].description; i++) { if ((strncmp(commands[i].name, text, sp - buf) == 0) && (commands[i].name[sp - buf] == 0)) break; + } + if (commands[i].name == NULL) return NULL; -- cgit