From 62855ccf36766a4662c8dac071411cac6f3be0f1 Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 10 May 1996 12:59:51 +0000 Subject: [PATCH] Fence off NULL args in getcmd() (fixes/works around PR#824) --- usr.bin/ftp/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.20.1