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 14:00:52 -0400

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");
+       return -1;
+}
+
     id->volume = volume;
     return 0;
 }
-- 
1.7.1




reply via email to

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