diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2020-06-18 05:33:17 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2020-06-18 05:33:17 +0000 |
commit | ef7d16e5dd72ca99438c434aab00886f33c795db (patch) | |
tree | 754c54d094959324665d241ece8e2ba0f51f4d1d /usr.bin/sndioctl | |
parent | 11b7ba943c908b291d86e537b9c5ac52999e094b (diff) |
Check control types and skip unknown ones.
Diffstat (limited to 'usr.bin/sndioctl')
-rw-r--r-- | usr.bin/sndioctl/sndioctl.c | 11 |
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 |