Skip to content

Commit 7ee382b

Browse files
authored
Merge pull request #11216 from paul-szczepanek-arm/fix-ad-parser
BLE: make advertising data parser handle early termination
2 parents b2b1ac1 + 8acd127 commit 7ee382b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

features/FEATURE_BLE/ble/gap/AdvertisingDataParser.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ class AdvertisingDataParser {
6969
if (position >= data.size()) {
7070
return false;
7171
}
72+
73+
/* early termination of packet, no more meaningful octets */
74+
if (current_length() == 0) {
75+
return false;
76+
}
7277

7378
if (position + current_length() >= data.size()) {
7479
return false;

0 commit comments

Comments
 (0)