summaryrefslogtreecommitdiff
path: root/usr.bin/ftp/main.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-10 12:59:52 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-05-10 12:59:52 +0000
commit1dc0b97d1d3cbd064eff34d05f6812b08b82fe2f (patch)
tree2140e95874ff9b533cdc046176d3afd60df1f851 /usr.bin/ftp/main.c
parentd6ccee176fc255e6ebed727528b23867ac35d81b (diff)
Fence off NULL args in getcmd() (fixes/works around PR#824)
Diffstat (limited to 'usr.bin/ftp/main.c')
-rw-r--r--usr.bin/ftp/main.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index 0c34202bb69..a9b2116bbf6 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -41,7 +41,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94";
#else
-static char rcsid[] = "$NetBSD: main.c,v 1.10 1995/09/15 00:32:33 pk Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.11 1996/05/07 00:16:55 pk Exp $";
#endif
#endif /* not lint */
@@ -288,6 +288,9 @@ getcmd(name)
struct cmd *c, *found;
int nmatches, longest;
+ if (name == NULL)
+ return (0);
+
longest = 0;
nmatches = 0;
found = 0;