Re: [pulseaudio-discuss] [PATCH] alsa-ucm: disallow null mdev argument into pa_alsa_open_mixer_by_name()

2020-07-06 Thread Tanu Kaskinen
On Wed, 2020-07-01 at 11:20 +0300, Eero Nurkkala wrote:
> It's possible for mdev to be NULL. In this case, an assert is taken
> in pa_alsa_open_mixer_by_name() with debug builds, and a crash with
> release builds. However, it's possible to bypass this trouble by taking
> the error path if mdev is NULL.
> 
> Reported-by: Jarkko Sankala 
> Signed-off-by: Eero Nurkkala 
> ---
>  src/modules/alsa/alsa-ucm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
> index 1dfb0e08b..295286555 100644
> --- a/src/modules/alsa/alsa-ucm.c
> +++ b/src/modules/alsa/alsa-ucm.c
> @@ -942,7 +942,7 @@ static void probe_volumes(pa_hashmap *hash, bool is_sink, 
> snd_pcm_t *pcm_handle,
>  mdev = mdev2;
>  }
>  
> -if (!(mixer_handle = pa_alsa_open_mixer_by_name(mixers, mdev, 
> true))) {
> +if (mdev == NULL || !(mixer_handle = 
> pa_alsa_open_mixer_by_name(mixers, mdev, true))) {
>  pa_log_error("Failed to find a working mixer device (%s).", 
> mdev);
>  goto fail;
>  }

Thanks! I merged this, and fixed another NULL pointer issue in the same
function.

Note that all patches must go through GitLab merge requests, so patch
submissions through GitLab are preferred.
https://gitlab.freedesktop.org/pulseaudio/pulseaudio

-- 
Tanu

https://www.patreon.com/tanuk
https://liberapay.com/tanuk

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss


[pulseaudio-discuss] [PATCH] alsa-ucm: disallow null mdev argument into pa_alsa_open_mixer_by_name()

2020-07-01 Thread Eero Nurkkala
It's possible for mdev to be NULL. In this case, an assert is taken
in pa_alsa_open_mixer_by_name() with debug builds, and a crash with
release builds. However, it's possible to bypass this trouble by taking
the error path if mdev is NULL.

Reported-by: Jarkko Sankala 
Signed-off-by: Eero Nurkkala 
---
 src/modules/alsa/alsa-ucm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/modules/alsa/alsa-ucm.c b/src/modules/alsa/alsa-ucm.c
index 1dfb0e08b..295286555 100644
--- a/src/modules/alsa/alsa-ucm.c
+++ b/src/modules/alsa/alsa-ucm.c
@@ -942,7 +942,7 @@ static void probe_volumes(pa_hashmap *hash, bool is_sink, 
snd_pcm_t *pcm_handle,
 mdev = mdev2;
 }
 
-if (!(mixer_handle = pa_alsa_open_mixer_by_name(mixers, mdev, true))) {
+if (mdev == NULL || !(mixer_handle = 
pa_alsa_open_mixer_by_name(mixers, mdev, true))) {
 pa_log_error("Failed to find a working mixer device (%s).", mdev);
 goto fail;
 }
-- 
2.17.1


-- 
Avast Antivirus on tarkistanut tämän sähköpostin virusten varalta.
https://www.avast.com/antivirus

___
pulseaudio-discuss mailing list
pulseaudio-discuss@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss