summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-04-15 22:38:11 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2009-04-15 22:38:11 +0300
commitf1af647c4beee2c5f13f454516a9f0d96aacf6ab (patch)
treebf5fb2a2b3c968cfbad2d1bba27ac30999e922ef
parent8cb3371db458e62117c316c22e2132585ed019d8 (diff)
downloadbluez-f1af647c4beee2c5f13f454516a9f0d96aacf6ab.tar.gz
Return proper error if HFP indicators aren't initialized
-rw-r--r--audio/headset.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/audio/headset.c b/audio/headset.c
index a14712098..c8a542148 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -402,6 +402,11 @@ static int report_indicators(struct audio_device *device, const char *buf)
if (strlen(buf) < 8)
return -EINVAL;
+ if (ag.indicators == NULL) {
+ error("HFP AG indicators not initialized");
+ return headset_send(hs, "\r\nERROR\r\n");
+ }
+
if (buf[7] == '=')
str = indicator_ranges(ag.indicators);
else