From 417b499689cdc7efc8af7fd4c68f7c5b6805a135 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Wed, 20 Dec 2017 15:03:39 +0100 Subject: [PATCH] avdtp initiator: reject set configuration cmd if stream endpoint is already configured --- src/classic/avdtp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/classic/avdtp.c b/src/classic/avdtp.c index 2e7289d32..5ec4a232b 100644 --- a/src/classic/avdtp.c +++ b/src/classic/avdtp.c @@ -957,7 +957,10 @@ uint8_t avdtp_set_configuration(uint16_t avdtp_cid, uint8_t local_seid, uint8_t log_error("avdtp: no initiator stream endpoint for seid %d", local_seid); return AVDTP_STREAM_ENDPOINT_DOES_NOT_EXIST; } - + if (stream_endpoint->state >= AVDTP_STREAM_ENDPOINT_CONFIGURED){ + log_error("avdtp: stream endpoint seid %d in wrong state", local_seid); + return AVDTP_STREAM_ENDPOINT_IN_WRONG_STATE; + } connection->active_stream_endpoint = (void*) stream_endpoint; connection->is_configuration_initiated_locally = 1; connection->is_initiator = 1;