]> git.alsa-project.org Git - alsa-lib.git/commit
ucm: fix crash when calling snd_use_case_geti() with no device or modifier
authorAntonio Ospite <ao2@ao2.it>
Fri, 23 Sep 2016 16:11:16 +0000 (18:11 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 29 Sep 2016 07:55:08 +0000 (09:55 +0200)
commit4ec907c773a807d58b17f909522c27d05878b5b5
tree4a3972a955577f6a827ff62a09f30ec7ff63f67d
parent0fc4b4d17bfd0ce44394f6040e1d5f9dfa97a5ad
ucm: fix crash when calling snd_use_case_geti() with no device or modifier

When calling snd_use_case_geti(uc_mgr, "_devstatus", &lvalue) the code
ends up calling device_status(uc_mgr, NULL), which result in a crash in
strcmp(dev->name, NULL), when there are enabled devices.

This happens because snd_use_case_geti() allows a "_devstatus"
identifier even if it's only supposed to allow the form
"_devstatus/{device}".

So check that the device name is not null.

The same issue occurs with "_modstatus", this change fixes that as well.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/ucm/main.c