Skip to contentSkip to conversation

ucm: Don't crash on attempts to set missing verbs

PATCH New Mark Brown 1 participant 1 message Oct 8, 2010

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 ucm: Don't crash on attempts to set missing verbs

Mostly for the benefit of alsaucm which passes the specified verb (if any) straight through, but the robustness fix seems better here.

---
 src/use-case.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
src/use-case.c +3 -0
index b45fe1f..ee44275 100644
@@ -2786,6 +2786,9 @@ int snd_use_case_set_verb(snd_use_case_mgr_t *uc_mgr,
 {
 	int i = 0, ret = -EINVAL, inactive = 0;
 
+	if (!verb_name)
+		return -EINVAL;
+
 	pthread_mutex_lock(&uc_mgr->mutex);
 
 	uc_dbg("uc_mgr %p, verb_name %s", uc_mgr, verb_name);
Signature · 1 line
1.7.1