From ef7d16e5dd72ca99438c434aab00886f33c795db Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Thu, 18 Jun 2020 05:33:17 +0000 Subject: Check control types and skip unknown ones. --- usr.bin/sndioctl/sndioctl.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'usr.bin') 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 * @@ -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 -- cgit v1.2.3