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: Trevor Saunders
Subject: [PATCH] bug fix null pointer dereference
Date: Thu, 2 Sep 2010 19:52:22 -0400

Hi,

On Fri, Sep 03, 2010 at 09:00:16AM +1000, Luke Yelavich wrote:
> 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.

well, this was a quick patch and I didn't spend a lot of time thinking
about the error message, but I'm not sure how to make it more useful
other than maybe adding the function we are in the message.

Trev

> 
> Luke
> 
> _______________________________________________
> Speechd mailing list
> Speechd at lists.freebsoft.org
> http://lists.freebsoft.org/mailman/listinfo/speechd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20100902/08fe96d9/attachment.pgp>


reply via email to

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