Bug 1469879 - Add check for closed socket on Multicast IPC parent funcs; r=baku
authorKyle Machulis <kyle@nonpolynomial.com>
Mon, 25 Jun 2018 16:59:08 -0700
changeset 423612 ca98b6f47b4e33673291a4dc2a4ebca28ce6db00
parent 423611 83d286f5134fd374fc4526093afd1be183bd868f
child 423613 2f413d5f9635112d0103dc76ffce0fa7bcd4692f
child 423680 f2c0891d9c26c0c7e7055a3615d4eb3a9b5577f0
push id34188
push userebalazs@mozilla.com
push dateTue, 26 Jun 2018 09:20:39 +0000
treeherdermozilla-central@ca98b6f47b4e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1469879
milestone63.0a1
first release with
nightly linux32
ca98b6f47b4e / 63.0a1 / 20180626100238 / files
nightly linux64
ca98b6f47b4e / 63.0a1 / 20180626100238 / files
nightly mac
ca98b6f47b4e / 63.0a1 / 20180626100238 / files
nightly win32
ca98b6f47b4e / 63.0a1 / 20180626100238 / files
nightly win64
ca98b6f47b4e / 63.0a1 / 20180626100238 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1469879 - Add check for closed socket on Multicast IPC parent funcs; r=baku MozReview-Commit-ID: CaNYPtgFz87
dom/network/UDPSocketParent.cpp
--- a/dom/network/UDPSocketParent.cpp
+++ b/dom/network/UDPSocketParent.cpp
@@ -445,29 +445,41 @@ UDPSocketParent::Send(const IPCStream& a
     FireInternalError(__LINE__);
   }
 }
 
 mozilla::ipc::IPCResult
 UDPSocketParent::RecvJoinMulticast(const nsCString& aMulticastAddress,
                                    const nsCString& aInterface)
 {
+  if (!mSocket) {
+    NS_WARNING("multicast socket is closed");
+    FireInternalError(__LINE__);
+    return IPC_OK();
+  }
+
   nsresult rv = mSocket->JoinMulticast(aMulticastAddress, aInterface);
 
   if (NS_WARN_IF(NS_FAILED(rv))) {
     FireInternalError(__LINE__);
   }
 
   return IPC_OK();
 }
 
 mozilla::ipc::IPCResult
 UDPSocketParent::RecvLeaveMulticast(const nsCString& aMulticastAddress,
                                     const nsCString& aInterface)
 {
+  if (!mSocket) {
+    NS_WARNING("multicast socket is closed");
+    FireInternalError(__LINE__);
+    return IPC_OK();
+  }
+
   nsresult rv = mSocket->LeaveMulticast(aMulticastAddress, aInterface);
 
   if (NS_WARN_IF(NS_FAILED(rv))) {
     FireInternalError(__LINE__);
   }
 
   return IPC_OK();
 }