From e297183416c482c5a589b7530d7da5a3d1ce4a58 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 2 Sep 2009 12:21:52 +0300 Subject: [PATCH] Reject AVDTP_DISCOVER when there are no SEPs available --- audio/avdtp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/audio/avdtp.c b/audio/avdtp.c index 3be3f64b6..40081e5f9 100644 --- a/audio/avdtp.c +++ b/audio/avdtp.c @@ -1152,6 +1152,13 @@ static gboolean avdtp_discover_cmd(struct avdtp *session, uint8_t transaction, gboolean ret; sep_count = g_slist_length(session->server->seps); + + if (sep_count == 0) { + uint8_t err = AVDTP_NOT_SUPPORTED_COMMAND; + return avdtp_send(session, transaction, AVDTP_MSG_TYPE_REJECT, + AVDTP_DISCOVER, &err, sizeof(err)); + } + rsp_size = sep_count * sizeof(struct seid_info); seps = g_new0(struct seid_info, sep_count);