Reject AVDTP_DISCOVER when there are no SEPs available

This commit is contained in:
Johan Hedberg 2009-09-02 12:21:52 +03:00
parent 23f3293d30
commit e297183416

View File

@ -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);