diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-06-08 13:31:41 -0500 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-06-08 13:31:41 -0500 |
commit | 52cfd888ea9cd602206af5aedbd9c49a84f5abe3 (patch) | |
tree | ad34bfa9f55c96644410f1f7b847638cc28c7fe2 /components/script/dom | |
parent | 1b7ac699bc5bf21bc936386da5bc2296bcee6abb (diff) | |
parent | 6fd7937665b5eefc67b4e94f3cc8be9ac8e92ffb (diff) | |
download | servo-52cfd888ea9cd602206af5aedbd9c49a84f5abe3.tar.gz servo-52cfd888ea9cd602206af5aedbd9c49a84f5abe3.zip |
Auto merge of #11652 - szeged:blacklistfix, r=jdm
Add blacklist check to GetIncludedService(s) functions
Somehow we missed it from our previous blacklist PR, to add blacklist check for the GetIncludedService() and GetIncludedServices() functions. Link for the spec: https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattservice-getincludedservice
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes do not require tests because there are no webbluetooth test api implementation yet.
<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11652)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom')
-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( |