summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2020-06-18 05:33:17 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2020-06-18 05:33:17 +0000
commitef7d16e5dd72ca99438c434aab00886f33c795db (patch)
tree754c54d094959324665d241ece8e2ba0f51f4d1d
parent11b7ba943c908b291d86e537b9c5ac52999e094b (diff)
Check control types and skip unknown ones.
-rw-r--r--usr.bin/sndioctl/sndioctl.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/usr.bin/sndioctl/sndioctl.c b/usr.bin/sndioctl/sndioctl.c
index 44579dc423a..ca98add3d13 100644
--- a/usr.bin/sndioctl/sndioctl.c
+++ b/usr.bin/sndioctl/sndioctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sndioctl.c,v 1.12 2020/06/18 05:28:49 ratchov Exp $ */
+/* $OpenBSD: sndioctl.c,v 1.13 2020/06/18 05:33:16 ratchov Exp $ */
/*
* Copyright (c) 2014-2020 Alexandre Ratchov <alex@caoua.org>
*
@@ -848,8 +848,15 @@ ondesc(void *arg, struct sioctl_desc *d, int curval)
}
}
- if (d->type == SIOCTL_NONE)
+ switch (d->type) {
+ case SIOCTL_NUM:
+ case SIOCTL_SW:
+ case SIOCTL_VEC:
+ case SIOCTL_LIST:
+ break;
+ default:
return;
+ }
/*
* find the right position to insert the new widget