diff options
author | Johan Hedberg <johan.hedberg@nokia.com> | 2010-04-02 22:41:53 +0300 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2010-04-02 22:41:53 +0300 |
commit | 23f75004d8a981927d32d150c88e16ec50c11fdd (patch) | |
tree | 6f727555199124fa56370c8a2c2de9c07b5f2665 | |
parent | 895eea1347243bae4aa65eea8531452fe5dd81ea (diff) | |
download | bluez-23f75004d8a981927d32d150c88e16ec50c11fdd.tar.gz |
Fix invalid memory access in headset_get_nrec when hs->slc is NULL
headset_get_nrec might get called when there's no SLC and it should
return the default NREC value in that case which is TRUE.
-rw-r--r-- | audio/headset.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/audio/headset.c b/audio/headset.c index 17938f729..1d9f8f22c 100644 --- a/audio/headset.c +++ b/audio/headset.c @@ -2685,6 +2685,9 @@ gboolean headset_get_nrec(struct audio_device *dev) { struct headset *hs = dev->headset; + if (!hs->slc) + return TRUE; + return hs->slc->nrec; } |