Bug 784766 - Verify that we only talk to processes that have permission to talk to us. r=cjones
authorBlake Kaplan <mrbkap@gmail.com>
Tue, 02 Oct 2012 11:18:17 -0400
changeset 109207 6ec6bc05c62fc500a111212939bf649da272ab29
parent 109206 6925601f42997b18e73e08b3c6e17fe41385337f
child 109208 5d0e0a533775956dc240b2661b9d9dba4aad9f3d
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewerscjones
bugs784766
milestone18.0a1
Bug 784766 - Verify that we only talk to processes that have permission to talk to us. r=cjones
dom/wifi/WifiWorker.js
--- a/dom/wifi/WifiWorker.js
+++ b/dom/wifi/WifiWorker.js
@@ -2008,16 +2008,20 @@ WifiWorker.prototype = {
   },
 
   _sendMessage: function(message, success, data, msg) {
     msg.manager.sendAsyncMessage(message + (success ? ":OK" : ":NO"),
                                  { data: data, rid: msg.rid, mid: msg.mid });
   },
 
   receiveMessage: function MessageManager_receiveMessage(aMessage) {
+    if (!aMessage.target.assertPermission("wifi-manage")) {
+      return;
+    }
+
     let msg = aMessage.json || {};
     msg.manager = aMessage.target;
 
     switch (aMessage.name) {
       case "WifiManager:getNetworks":
         this.getNetworks(msg);
         break;
       case "WifiManager:getKnownNetworks":