OSDN Git Service

ucm: fix out-of-array access in rval_device_lookup_init()
authorJaroslav Kysela <perex@perex.cz>
Wed, 2 Jun 2021 18:01:08 +0000 (20:01 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 2 Jun 2021 18:01:08 +0000 (20:01 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/ucm_subs.c

index 0bc4e63..20905c3 100644 (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);