diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2003-05-29 15:39:53 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2003-05-29 15:39:53 +0000 |
commit | 62e1bafe1c5a85eab4f80b6343e7c80dfa80fbf4 (patch) | |
tree | ecc516a4ed1a81a6d8f0cd763e0a8a82eb88ca71 /source3 | |
parent | d75a4281c5a96a1e29b34b3a2f10bdb089221b77 (diff) | |
download | samba-62e1bafe1c5a85eab4f80b6343e7c80dfa80fbf4.tar.gz samba-62e1bafe1c5a85eab4f80b6343e7c80dfa80fbf4.tar.bz2 samba-62e1bafe1c5a85eab4f80b6343e7c80dfa80fbf4.zip |
Don't crash when doing command name completion. Fixes debian bug #194776
(This used to be commit 45b0a63aba1c974e5e38f8f95bc158bc30a05a3b)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/client/client.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |