From: Lu Guanqun Date: Fri, 19 Aug 2011 08:05:25 +0000 (+0800) Subject: ucm: fix seg fault in execute_cset() X-Git-Tag: v1.0.25~19 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=29880e8c66cfdc584e01aa549037f76b081b5019;p=alsa-lib.git ucm: fix seg fault in execute_cset() When there's no space in 'cset', 'pos' gets NULL, dereferencing 'pos' gets a seg fault. We need to be more robust. Signed-off-by: Lu Guanqun Signed-off-by: Takashi Iwai --- diff --git a/src/ucm/main.c b/src/ucm/main.c index 8e9a85d2..9ecbe435 100644 --- a/src/ucm/main.c +++ b/src/ucm/main.c @@ -196,7 +196,8 @@ static int execute_cset(snd_ctl_t *ctl, char *cset) goto __fail; err = 0; __fail: - *pos = ' '; + if (pos != NULL) + *pos = ' '; if (id != NULL) free(id);