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

Side by Side Diff: device/bluetooth/bluetooth_adapter_profile_chromeos.cc

Issue 997023002: Fix a null-pointer dereference in ChromeOS Bluetooth code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "device/bluetooth/bluetooth_adapter_profile_chromeos.h" 5 #include "device/bluetooth/bluetooth_adapter_profile_chromeos.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 10 matching lines...) Expand all
21 // static 21 // static
22 void BluetoothAdapterProfileChromeOS::Register( 22 void BluetoothAdapterProfileChromeOS::Register(
23 const device::BluetoothUUID& uuid, 23 const device::BluetoothUUID& uuid,
24 const BluetoothProfileManagerClient::Options& options, 24 const BluetoothProfileManagerClient::Options& options,
25 const ProfileRegisteredCallback& success_callback, 25 const ProfileRegisteredCallback& success_callback,
26 const BluetoothProfileManagerClient::ErrorCallback& error_callback) { 26 const BluetoothProfileManagerClient::ErrorCallback& error_callback) {
27 scoped_ptr<BluetoothAdapterProfileChromeOS> profile( 27 scoped_ptr<BluetoothAdapterProfileChromeOS> profile(
28 new BluetoothAdapterProfileChromeOS(uuid)); 28 new BluetoothAdapterProfileChromeOS(uuid));
29 29
30 VLOG(1) << "Registering profile: " << profile->object_path().value(); 30 VLOG(1) << "Registering profile: " << profile->object_path().value();
31 const dbus::ObjectPath& object_path = profile->object_path();
31 DBusThreadManager::Get()->GetBluetoothProfileManagerClient()->RegisterProfile( 32 DBusThreadManager::Get()->GetBluetoothProfileManagerClient()->RegisterProfile(
32 profile->object_path(), 33 object_path,
armansito 2015/03/11 06:48:38 I really don't see how this is a NULL pointer dere
Ilya Sherman 2015/03/11 09:23:54 I agree that it's surprising that unit tests didn'
armansito 2015/03/11 16:44:29 OK, I guess that makes sense. I would elaborate a
armansito 2015/03/11 17:09:24 Also, it's not technically a NULL-pointer derefere
33 uuid.canonical_value(), 34 uuid.canonical_value(),
34 options, 35 options,
35 base::Bind(success_callback, base::Passed(&profile)), 36 base::Bind(success_callback, base::Passed(&profile)),
36 error_callback); 37 error_callback);
37 } 38 }
38 39
39 BluetoothAdapterProfileChromeOS::BluetoothAdapterProfileChromeOS( 40 BluetoothAdapterProfileChromeOS::BluetoothAdapterProfileChromeOS(
40 const device::BluetoothUUID& uuid) 41 const device::BluetoothUUID& uuid)
41 : uuid_(uuid), weak_ptr_factory_(this) { 42 : uuid_(uuid), weak_ptr_factory_(this) {
42 std::string uuid_path; 43 std::string uuid_path;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 // Cancel() should only go to a delegate accepting connections. 153 // Cancel() should only go to a delegate accepting connections.
153 if (delegates_.find("") == delegates_.end()) { 154 if (delegates_.find("") == delegates_.end()) {
154 VLOG(1) << object_path_.value() << ": Cancel with no delegate!"; 155 VLOG(1) << object_path_.value() << ": Cancel with no delegate!";
155 return; 156 return;
156 } 157 }
157 158
158 delegates_[""]->Cancel(); 159 delegates_[""]->Cancel();
159 } 160 }
160 161
161 } // namespace chromeos 162 } // namespace chromeos
OLDNEW
« 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