[alsa-devel] [PATCH] ucm: Fix segfault when device argument is missing from _sw{dev, mod}

Juho Hämäläinen juho.hamalainen at tieto.com
Fri May 24 10:12:57 CEST 2013


Signed-off-by: Juho Hämäläinen <juho.hamalainen at tieto.com>
---
 src/ucm/main.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/ucm/main.c b/src/ucm/main.c
index d38b7fa..74e1530 100644
--- a/src/ucm/main.c
+++ b/src/ucm/main.c
@@ -1649,6 +1649,10 @@ int snd_use_case_set(snd_use_case_mgr_t *uc_mgr,
                 } else {
                         str = NULL;
                 }
+                if (!str) {
+                    err = -EINVAL;
+                    goto __end;
+                }
                 if (check_identifier(identifier, "_swdev"))
                         err = switch_device(uc_mgr, str, value);
                 else if (check_identifier(identifier, "_swmod"))
-- 
1.7.10.4



More information about the Alsa-devel mailing list