speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH] bug fix null pointer dereference


From: Luke Yelavich
Subject: [PATCH] bug fix null pointer dereference
Date: Fri, 3 Sep 2010 09:00:16 +1000

On Fri, Sep 03, 2010 at 04:00:52AM EST, Trevor Saunders wrote:
> spd_audio_set_volume() doesn't check that the audio id it is given is
> valid.
> ---
>  src/audio/spd_audio.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/src/audio/spd_audio.c b/src/audio/spd_audio.c
> index a8da0f3..c1c1a8a 100644
> --- a/src/audio/spd_audio.c
> +++ b/src/audio/spd_audio.c
> @@ -236,6 +236,11 @@ spd_audio_set_volume(AudioID *id, int volume)
>       return -1;
>      }
>  
> +if(id == NULL){
> +     fprintf(stderr, "audio id is NULL\n");

This looks good to me, except for the error message. Indicating a variable is 
NULL doesn't at least to me, clearly state where something has gone wrong.

Luke



reply via email to

[Prev in Thread] Current Thread [Next in Thread]