summaryrefslogtreecommitdiff
path: root/usr.bin/sndioctl
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2021-12-25 16:25:08 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2021-12-25 16:25:08 +0000
commit3bccc368a234445893a32f211fb31ea2a2ce2393 (patch)
tree77633960c846dffa76f3cbae58e79df45e24d0a8 /usr.bin/sndioctl
parente3a14be520d8edba65613c1adb5a6cfc9fe71d95 (diff)
Don't accept an empty string as selector value
"looks good" edd@
Diffstat (limited to 'usr.bin/sndioctl')
-rw-r--r--usr.bin/sndioctl/sndioctl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/sndioctl/sndioctl.c b/usr.bin/sndioctl/sndioctl.c
index aa174e77249..ffe0654fa94 100644
--- a/usr.bin/sndioctl/sndioctl.c
+++ b/usr.bin/sndioctl/sndioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sndioctl.c,v 1.16 2021/03/03 09:40:43 ratchov Exp $ */
+/* $OpenBSD: sndioctl.c,v 1.17 2021/12/25 16:25:07 ratchov Exp $ */
/*
* Copyright (c) 2014-2020 Alexandre Ratchov <alex@caoua.org>
*
@@ -706,6 +706,11 @@ cmd(char *line)
}
break;
case SIOCTL_SEL:
+ if (*pos == '\0') {
+ fprintf(stderr, "%s.%s: expects value\n", astr, func);
+ exit(1);
+ }
+ /* FALLTROUGH */
case SIOCTL_VEC:
case SIOCTL_LIST:
for (i = g; i != NULL; i = nextpar(i)) {