summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-09-02 10:52:37 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-09-03 16:28:38 +0300
commita4bec4749fb0e0f402fd6c2e0bb6774ea857a388 (patch)
treea2ab901752c9f7c97a7b27ec90a1ef48c6c59c22
parent498e067aba400d53e176d6914fa493efc2dbf0ef (diff)
downloadbluez-a4bec4749fb0e0f402fd6c2e0bb6774ea857a388.tar.gz
audio/avrcp: Fix not handling errors for GetCapabilities
According to the spec GetCapabilities is mandatory for both TG and CT but some devices reject it anyway which can lead to a crash if not handled properly.
-rw-r--r--profiles/audio/avrcp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index 4dbad1acb..5c3c4f982 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -3227,7 +3227,8 @@ static gboolean avrcp_get_capabilities_resp(struct avctp *conn,
uint16_t events = 0;
uint8_t count;
- if (pdu == NULL || pdu->params[0] != CAP_EVENTS_SUPPORTED)
+ if (code == AVC_CTYPE_REJECTED || code == AVC_CTYPE_NOT_IMPLEMENTED ||
+ pdu == NULL || pdu->params[0] != CAP_EVENTS_SUPPORTED)
return FALSE;
/* Connect browsing if pending */