diff options
author | zakorgyula <gyula.zakor@gmail.com> | 2016-06-07 10:38:28 +0200 |
---|---|---|
committer | zakorgyula <gyula.zakor@gmail.com> | 2016-06-07 10:38:28 +0200 |
commit | 6fd7937665b5eefc67b4e94f3cc8be9ac8e92ffb (patch) | |
tree | 01cc2999d599bc0407183c85363459e07b9ed295 /components/script/dom/bluetoothremotegattservice.rs | |
parent | 0f1f99a4bf3be2f695b402e8676c3b0b935cbc5b (diff) | |
download | servo-6fd7937665b5eefc67b4e94f3cc8be9ac8e92ffb.tar.gz servo-6fd7937665b5eefc67b4e94f3cc8be9ac8e92ffb.zip |
Add blacklist check to GetIncludedSevice(s) functions
Diffstat (limited to 'components/script/dom/bluetoothremotegattservice.rs')
-rw-r--r-- | components/script/dom/bluetoothremotegattservice.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/components/script/dom/bluetoothremotegattservice.rs b/components/script/dom/bluetoothremotegattservice.rs index 48cf9be6361..cf0f896d3f6 100644 --- a/components/script/dom/bluetoothremotegattservice.rs +++ b/components/script/dom/bluetoothremotegattservice.rs @@ -170,6 +170,9 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService { service: BluetoothServiceUUID) -> Fallible<Root<BluetoothRemoteGATTService>> { let uuid = try!(BluetoothUUID::GetService(self.global().r(), service)).to_string(); + if uuid_is_blacklisted(uuid.as_ref(), Blacklist::All) { + return Err(Security) + } let (sender, receiver) = ipc::channel().unwrap(); self.get_bluetooth_thread().send( BluetoothMethodMsg::GetIncludedService(self.get_instance_id(), @@ -196,7 +199,12 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService { -> Fallible<Vec<Root<BluetoothRemoteGATTService>>> { let mut uuid: Option<String> = None; if let Some(s) = service { - uuid = Some(try!(BluetoothUUID::GetService(self.global().r(), s)).to_string()) + uuid = Some(try!(BluetoothUUID::GetService(self.global().r(), s)).to_string()); + if let Some(ref uuid) = uuid { + if uuid_is_blacklisted(uuid.as_ref(), Blacklist::All) { + return Err(Security) + } + } }; let (sender, receiver) = ipc::channel().unwrap(); self.get_bluetooth_thread().send( |