Merge pull request #11216 from paul-szczepanek-arm/fix-ad-parser

BLE: make advertising data parser handle early termination
pull/11264/head
Martin Kojtal 2019-08-20 09:59:18 +02:00 committed by GitHub
commit 7ee382bdc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -69,6 +69,11 @@ public:
if (position >= data.size()) {
return false;
}
/* early termination of packet, no more meaningful octets */
if (current_length() == 0) {
return false;
}
if (position + current_length() >= data.size()) {
return false;