]> git.alsa-project.org Git - alsa-lib.git/commitdiff
ucm: be more restrictive for device name with descriptor
authorJaroslav Kysela <perex@perex.cz>
Tue, 18 Nov 2025 13:00:48 +0000 (14:00 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 18 Nov 2025 13:00:48 +0000 (14:00 +0100)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/ucm/parser.c

index 2c0d2678d21664b078d00608855e3310ac239025..5205dff78ce8341b45d4fbb4074413c22337c930 100644 (file)
@@ -1970,6 +1970,11 @@ static int verb_normalize_device_names(snd_use_case_mgr_t *uc_mgr, struct use_ca
 
                colon = strchr(norm_name, ':');
                if (colon) {
+                       if (colon[1] == '\0' || strchr(colon + 1, ' ')) {
+                               snd_error(UCM, "device descriptor cannot be empty or contain spaces '%s'", orig_name);
+                               err = -EINVAL;
+                               goto __error;
+                       }
                        *colon = '\0';
                        index = 1;
                        do {