Skip to content
Snippets Groups Projects
Commit 0d7e3d8f authored by Hui Peng's avatar Hui Peng
Browse files

Fix an OOB bug in parse_gap_data

Bug: 277590580
bug: 275553827
Test: atest net_test_main_shim
Ignore-AOSP-First: security
Tag: #security
Merged-In: I7fcb7c46f668f48560a72399a3c5087c6da3827f
Change-Id: I7fcb7c46f668f48560a72399a3c5087c6da3827f
parent 08690d66
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,10 @@ void parse_gap_data(const std::vector<uint8_t> &raw_data,
hci::GapData gap_data;
uint8_t len = raw_data[offset];
if (offset + len + 1 > raw_data.size()) {
break;
}
auto begin = raw_data.begin() + offset;
auto end = begin + len + 1; // 1 byte for len
auto data_copy = std::make_shared<std::vector<uint8_t>>(begin, end);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment