Re: [PATCH V2 1/1] ASoC: add a core API to share more product information with user space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 30 Mar 2016 10:52:32 +0200,
han.lu@xxxxxxxxx wrote:
> 
> +	/* card long name / card component */
> +	name = kstrdup(card->name, GFP_KERNEL);
> +	if (!name)
> +		return -ENOMEM;
> +	strcat(name, ":");
> +	strcat(name, card->driver_name);
> +	strcat(name, ":");
> +	if (vendor)
> +		strcat(name, vendor);
> +	strcat(name, ":");
> +	if (firmware)
> +		strcat(name, firmware);

strcat() can't be used in that way.  You'd need to allocate an enough
large string buffer, and use strlcat() to fill in.

Also, ideally check whether each name string has no colon letter
included.  Otherwise it'll confuse the parser in user space.


thanks,

Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux