ucm: fix out-of-array access in rval_device_lookup_init()

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2021-06-02 20:01:08 +02:00
parent 64a6d4d1e8
commit 30d1d256e7

View file

@ -489,7 +489,7 @@ static int rval_device_lookup_init(snd_use_case_mgr_t *uc_mgr,
uc_error("Missing device type!");
return -EINVAL;
}
for (t = types; t; t++)
for (t = types; t->name; t++)
if (strcasecmp(t->name, s) == 0)
return t->init(iter, config);
uc_error("Device type '%s' is invalid", s);