Re: [PATCH] alsa-lib: pcm: segmentation fault snd_pcm_open

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

 



On Fri, 08 Dec 2017 15:19:55 +0100,
Markus Seeber wrote:
> 
> Previously, calling snd_pcm_open with a null pointer argument for
> "name" caused a segmentation fault in snd_config_search_definition.
> The segmentation fault resulted from invoking undefined behavior by
> calling strchr with a null pointer argument.
> 
> The issue can be reproduced by passing a null pointer for "name" to
> snd_pcm_open.
> 
> To prevent this instance of strchr to be invoked with a null pointer
> argument, snd_config_search_definition now returns EINVAL if argument
> "name" is a null pointer.
> 
> Signed-off-by: Markus Seeber <markus.seeber@xxxxxxxxxxxxxxx>

The NULL check of name argument is done in the caller side via
assert() in snd_pcm_open().   So this check is redundant.

It's another question whether we should make the check mandatory
instead of assert(), though.  Basically it's a bug of the application
that calls with name=NULL, and assert() was considered to catch that.


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