summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-04-05 15:53:12 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-04-05 15:53:12 -0700
commit759d1442a5dcc96466ee0758c695e83b8524ab64 (patch)
treebd146078120a382f09d802f30941cb9400f82d1b /src
parenta1b93db14da6772a299492a0c0673be70bea9ea6 (diff)
downloadbluez-759d1442a5dcc96466ee0758c695e83b8524ab64.tar.gz
shared/ad: Fix bt_ad_has_data not matching when only type is passed
bt_ad_has_data attempts to match the data portion even when not set which is useful the user is only interested in actually mataching the type alone.
Diffstat (limited to 'src')
-rw-r--r--src/shared/ad.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/ad.c b/src/shared/ad.c
index 27b76dc81..7350aa206 100644
--- a/src/shared/ad.c
+++ b/src/shared/ad.c
@@ -1028,6 +1028,9 @@ static bool data_match(const void *data, const void *user_data)
if (d1->type != d2->type)
return false;
+ if (!d2->len && !d2->data)
+ return true;
+
if (d1->len != d2->len)
return false;