mirror of
https://github.com/servo/servo.git
synced 2025-06-25 17:44:33 +01:00
Add blacklist check to GetIncludedSevice(s) functions
This commit is contained in:
parent
0f1f99a4bf
commit
6fd7937665
1 changed files with 9 additions and 1 deletions
|
@ -170,6 +170,9 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
|
||||||
service: BluetoothServiceUUID)
|
service: BluetoothServiceUUID)
|
||||||
-> Fallible<Root<BluetoothRemoteGATTService>> {
|
-> Fallible<Root<BluetoothRemoteGATTService>> {
|
||||||
let uuid = try!(BluetoothUUID::GetService(self.global().r(), service)).to_string();
|
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();
|
let (sender, receiver) = ipc::channel().unwrap();
|
||||||
self.get_bluetooth_thread().send(
|
self.get_bluetooth_thread().send(
|
||||||
BluetoothMethodMsg::GetIncludedService(self.get_instance_id(),
|
BluetoothMethodMsg::GetIncludedService(self.get_instance_id(),
|
||||||
|
@ -196,7 +199,12 @@ impl BluetoothRemoteGATTServiceMethods for BluetoothRemoteGATTService {
|
||||||
-> Fallible<Vec<Root<BluetoothRemoteGATTService>>> {
|
-> Fallible<Vec<Root<BluetoothRemoteGATTService>>> {
|
||||||
let mut uuid: Option<String> = None;
|
let mut uuid: Option<String> = None;
|
||||||
if let Some(s) = service {
|
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();
|
let (sender, receiver) = ipc::channel().unwrap();
|
||||||
self.get_bluetooth_thread().send(
|
self.get_bluetooth_thread().send(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue