From: deraadt Date: Fri, 10 May 1996 12:59:51 +0000 (+0000) Subject: Fence off NULL args in getcmd() (fixes/works around PR#824) X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=62855ccf36766a4662c8dac071411cac6f3be0f1;p=openbsd Fence off NULL args in getcmd() (fixes/works around PR#824) --- 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;