From 97413ec61430ce999d3e6fa0e1880ec01d61f9df Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Sun, 28 Jun 2020 07:52:52 +0200 Subject: [PATCH] sndioctl: Check control types and skip unknown ones --- sndioctl/sndioctl.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sndioctl/sndioctl.c b/sndioctl/sndioctl.c index 0345dc6..4c4a85a 100644 --- a/sndioctl/sndioctl.c +++ b/sndioctl/sndioctl.c @@ -858,8 +858,16 @@ 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: + case SIOCTL_SEL: + break; + default: return; + } /* * find the right position to insert the new widget