From 29b9f31d993e3482b4a9e47d10f8f8fa38ee02a6 Mon Sep 17 00:00:00 2001 From: Keith Bostic Date: Mon, 28 Mar 1994 15:03:12 -0800 Subject: [PATCH] The 'for' loop checks the contents of cp w/o ever checking that it's not NULL. From: "Chris G. Demetriou" SCCS-vsn: sbin/dump/main.c 8.3 --- usr/src/sbin/dump/main.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr/src/sbin/dump/main.c b/usr/src/sbin/dump/main.c index 07347ec51a..d91397b8ad 100644 --- a/usr/src/sbin/dump/main.c +++ b/usr/src/sbin/dump/main.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 1980, 1991, 1993 + * Copyright (c) 1980, 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. * * %sccs.include.redist.c% @@ -7,12 +7,12 @@ #ifndef lint static char copyright[] = -"@(#) Copyright (c) 1980, 1991, 1993\n\ +"@(#) Copyright (c) 1980, 1991, 1993, 1994\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint -static char sccsid[] = "@(#)main.c 8.2 (Berkeley) %G%"; +static char sccsid[] = "@(#)main.c 8.3 (Berkeley) %G%"; #endif /* not lint */ #include @@ -85,6 +85,10 @@ main(argc, argv) if (TP_BSIZE / DEV_BSIZE == 0 || TP_BSIZE % DEV_BSIZE != 0) quit("TP_BSIZE must be a multiple of DEV_BSIZE\n"); level = '0'; + if (argc == 1) { + (void) fprintf(stderr, "Must specify a key.\n"); + Exit(X_ABORT); + } argv++; argc -= 2; for (cp = *argv++; *cp; cp++) { -- 2.20.1