diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2015-02-16 15:02:28 +0200 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-02-19 15:21:08 +0200 |
commit | 16ad0a71a26fc47afab66d5d882492d0c8312bab (patch) | |
tree | 1137c9479a67037665f7034c95a8761f827809bb /android/avdtp.c | |
parent | 20890b9d5836aaab673216814a9035414aa2e789 (diff) | |
download | bluez-16ad0a71a26fc47afab66d5d882492d0c8312bab.tar.gz |
android/avdtp: Fix registering SEP with wrong SEID
Add seid check fixing registering too many SEPs
Diffstat (limited to 'android/avdtp.c')
-rw-r--r-- | android/avdtp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/android/avdtp.c b/android/avdtp.c index ce75615d3..b290feb27 100644 --- a/android/avdtp.c +++ b/android/avdtp.c @@ -3352,6 +3352,10 @@ struct avdtp_local_sep *avdtp_register_sep(uint8_t type, uint8_t media_type, void *user_data) { struct avdtp_local_sep *sep; + uint8_t seid = util_get_uid(&seids, MAX_SEID); + + if (!seid) + return NULL; if (g_slist_length(lseps) > MAX_SEID) return NULL; @@ -3359,7 +3363,7 @@ struct avdtp_local_sep *avdtp_register_sep(uint8_t type, uint8_t media_type, sep = g_new0(struct avdtp_local_sep, 1); sep->state = AVDTP_STATE_IDLE; - sep->info.seid = util_get_uid(&seids, MAX_SEID); + sep->info.seid = seid; sep->info.type = type; sep->info.media_type = media_type; sep->codec = codec_type; |