diff options
author | Pauli Virtanen <pav@iki.fi> | 2021-09-05 18:43:55 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-09-06 21:36:10 -0700 |
commit | 0d09a5d339634ffd062dccf03739cb7c29abd060 (patch) | |
tree | 76f221a9172a6aa10db347099af993b220d6ed24 /unit | |
parent | 64e7ce42b19122f0ad47a4a32e6311bdffb38200 (diff) | |
download | bluez-0d09a5d339634ffd062dccf03739cb7c29abd060.tar.gz |
shared/util: use 64-bit bitmap in util_get/clear_uid
The util_get/clear_uid functions use int type for bitmap, and are used
e.g. for SEID allocation. However, valid SEIDs are in range 1 to 0x3E
(AVDTP spec v1.3, 8.20.1), and 8*sizeof(int) is often smaller than 0x3E.
The function is also used in src/advertising.c, but an explicit maximum
value is always provided, so growing the bitmap size is safe there.
Use 64-bit bitmap instead, to be able to cover the valid range.
Diffstat (limited to 'unit')
-rw-r--r-- | unit/test-avdtp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/unit/test-avdtp.c b/unit/test-avdtp.c index f5340d6f3..4e8a68c6b 100644 --- a/unit/test-avdtp.c +++ b/unit/test-avdtp.c @@ -550,7 +550,7 @@ static void test_server_seid(gconstpointer data) struct avdtp_local_sep *sep; unsigned int i; - for (i = 0; i < sizeof(int) * 8; i++) { + for (i = 0; i < MAX_SEID; i++) { sep = avdtp_register_sep(context->lseps, AVDTP_SEP_TYPE_SINK, AVDTP_MEDIA_TYPE_AUDIO, 0x00, TRUE, &sep_ind, NULL, |