From d1968b90c7d34f3b6db14188d48d5c73d26cb493 Mon Sep 17 00:00:00 2001 From: Mike Pritchard Date: Mon, 15 Jan 1996 09:11:17 +0000 Subject: [PATCH] Fixed to not core dump if not enough arguments are given with the +rec and -rec options. --- usr.sbin/mixer/mixer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.sbin/mixer/mixer.c b/usr.sbin/mixer/mixer.c index 2ce07a0fb10b..ac602940699d 100644 --- a/usr.sbin/mixer/mixer.c +++ b/usr.sbin/mixer/mixer.c @@ -99,6 +99,10 @@ main(int argc, char *argv[]) if (foo >= SOUND_MIXER_NRDEVICES) { if (!strcmp("+rec", argv[1]) || !strcmp("-rec", argv[1])) { + if (argc != 3) { + usage(); + /* NOTREACHED */ + } for (dev = 0; dev < SOUND_MIXER_NRDEVICES && strcmp(names[dev], argv[2]); dev++); if (dev >= SOUND_MIXER_NRDEVICES) usage();