mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-17 01:04:40 +08:00
AVDTP Qualification: Fix error handling for AVDTP set configuration command.
This commit is contained in:
parent
d75aa0393e
commit
83e5483ee1
@ -1200,6 +1200,7 @@ static gboolean avdtp_setconf_cmd(struct avdtp *session, uint8_t transaction,
|
||||
uint8_t err, category = 0x00;
|
||||
struct audio_device *dev;
|
||||
bdaddr_t src, dst;
|
||||
GSList *l;
|
||||
|
||||
if (size < sizeof(struct setconf_req)) {
|
||||
error("Too short getcap request");
|
||||
@ -1247,6 +1248,16 @@ static gboolean avdtp_setconf_cmd(struct avdtp *session, uint8_t transaction,
|
||||
size - sizeof(struct setconf_req),
|
||||
&stream->codec);
|
||||
|
||||
/* Verify that the Media Transport capability's length = 0. Reject otherwise */
|
||||
for (l = stream->caps; l != NULL; l = g_slist_next(l)) {
|
||||
struct avdtp_service_capability *cap = l->data;
|
||||
|
||||
if (cap->category == AVDTP_MEDIA_TRANSPORT && cap->length != 0) {
|
||||
err = AVDTP_BAD_MEDIA_TRANSPORT_FORMAT;
|
||||
goto failed;
|
||||
}
|
||||
}
|
||||
|
||||
if (sep->ind && sep->ind->set_configuration) {
|
||||
if (!sep->ind->set_configuration(session, sep, stream,
|
||||
stream->caps, &err,
|
||||
|
Loading…
Reference in New Issue
Block a user