summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@intel.com>2011-08-19 16:05:25 +0800
committerTakashi Iwai <tiwai@suse.de>2011-08-19 10:41:26 +0200
commit29880e8c66cfdc584e01aa549037f76b081b5019 (patch)
tree76efefa842d902970d759b8030b000dde9e050d1
parent78dbc57b9918a5c0a29eb70f36af6d21b9471e9d (diff)
downloadalsa-lib-29880e8c66cfdc584e01aa549037f76b081b5019.tar.gz
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 <guanqun.lu@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--src/ucm/main.c3
1 files changed, 2 insertions, 1 deletions
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);