[multiple] Fix crashes from malformed external input (batch 2) (#14651)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
9418f35cc3
commit
fecedeb018
6 files changed
+46
-1
No files matched your search
@@ -514,6 +514,11 @@ void ESPBTDevice::parse_adv_(const uint8_t *payload, uint8_t len) {
|
||||
continue; // Possible zero padded advertisement data
|
||||
}
|
||||
|
||||
// Validate field fits in remaining payload
|
||||
if (offset + field_length > len) {
|
||||
break;
|
||||
}
|
||||
|
||||
// first byte of adv record is adv record type
|
||||
const uint8_t record_type = payload[offset++];
|
||||
const uint8_t *record = &payload[offset];
|
||||
|
||||
Reference in new issue
Block a user