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>
This commit is contained in:
Lu Guanqun 2011-08-19 16:05:25 +08:00 committed by Takashi Iwai
parent 78dbc57b99
commit 29880e8c66

View file

@ -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);