Chromium Code Reviews| 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..45d550bfea6914072da5db72727350535f8dae83 100644 |
| --- a/chromeos/components/tether/ble_scanner.cc |
| +++ b/chromeos/components/tether/ble_scanner.cc |
| @@ -228,7 +228,8 @@ 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()); |
| + string_contents_ptr[service_data->size()] = '\0'; |
|
Lei Zhang
2017/06/16 22:57:37
Do you actually need to NUL-terminate the raw stri
Kyle Horimoto
2017/06/16 23:05:04
I checked, and you don't. Removed.
|
| CheckForMatchingScanFilters(bluetooth_device, service_data_str); |
| } |