Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: chromeos/components/tether/ble_scanner.cc

Issue 2943793002: [CrOS Tether] Fix a buffer overflow issue caught by the ASAN bots. (Closed)
Patch Set: thestig@ comment. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/components/tether/ble_scanner.cc
diff --git a/chromeos/components/tether/ble_scanner.cc b/chromeos/components/tether/ble_scanner.cc
index 5ed761d731f36c666f7f003c9d16dd78ba10e20e..709e5f5c30a2904924b53534e8fc7d57f9d08a1d 100644
--- a/chromeos/components/tether/ble_scanner.cc
+++ b/chromeos/components/tether/ble_scanner.cc
@@ -228,7 +228,7 @@ void BleScanner::HandleDeviceUpdated(
std::string service_data_str;
char* string_contents_ptr =
base::WriteInto(&service_data_str, service_data->size() + 1);
- memcpy(string_contents_ptr, service_data->data(), service_data->size() + 1);
+ memcpy(string_contents_ptr, service_data->data(), service_data->size());
CheckForMatchingScanFilters(bluetooth_device, service_data_str);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698