Skip to contentSkip to conversation

UCM list 'modifiers' Seg-Fault when list is empty

PATCH Alejandro Gonzalez 1 participant 1 message Mar 16, 2011

lore
Share & tools
lore
#0 lore raw

Hi,

I've been testing the Alsa UCM and find that when listing 'modifiers' there is a segmentation fault if the list is empty.

$ alsaucm -c Panda set _verb HiFi list _modifiers
  Im setting defaults
    list is empty
 Segmentation fault (core dumped)

Using 'gdb' I see that the issue is trying to free a not NULL pointer. Program received signal SIGSEGV, Segmentation fault. 0x402a096c in free () from /lib/libc.so.6
(gdb) bt

#0  0x402a096c in free () from /lib/libc.so.6
#1  0x40221224 in snd_use_case_free_list () from /usr/lib/libasound.so.2
#2  0x00008d8a in do_one (context=0x13008) at usecase.c:256
#3  do_commands (context=0x13008) at usecase.c:329
#4  0x000091aa in main (argc=<value optimized out>, argv=0xbe9986c4) at

usecase.c:440
(gdb) quit

But this can be easily resolved with the correct initialization of the '**list' pointer on the 'do_one' function in 'alsaucm/usecase.c'.

You can find a patch attached to the mail.

Regards,

Alejandro

alsaucm/usecase.c renamed from home/ubuntu/usecase.c +1 -1
@@ -170,7 +170,7 @@
 
 static int do_one(struct context *context, struct cmd *cmd, char **argv)
 {
-	const char **list, *str;
+	const char **list=NULL, *str;
 	long lval;
 	int err, i;
 

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel