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 810712 ca98b6f47b4e33673291a4dc2a4ebca28ce6db00
parent 810711 83d286f5134fd374fc4526093afd1be183bd868f
child 810713 761107bb53ee83cebc72427fda3c9f449c7e27fc
child 810727 f2c0891d9c26c0c7e7055a3615d4eb3a9b5577f0
child 810732 7fca73d6ef3738f1e4eb1fec0142cf3478e6c6ad
child 810734 2723c85f9318a0f83c5d82c14a894f77eef10ccb
child 810739 70b718b34a5105fd250f36350b10ee2be6dc9c16
child 810752 074294ee69e69566079af454d2968a353fc78d1a
child 810777 8e1088397bffdef40f5bfff5e8d3f4898971e216
child 810793 e827ed2099f4fc4d1d9e43942c285303f7ec8d7d
child 810800 d517312087e76d82c10bb086caeeddfae2cc75fd
child 810806 ed74ebc661ff8f99f84a8ab6fae0b4ccad2e79a0
child 810811 2f413d5f9635112d0103dc76ffce0fa7bcd4692f
child 810829 048af89fdc651aed59e0d97162886c6017f17e14
child 810830 0077957b8112278649e7425657e3136d30deded4
child 810870 61032f97a457ac97591c479de9e558ae6660376b
child 810881 766c1fadd8500ea64de77990e4282b0cf4a2d5f3
child 810985 33171ce09393ecac1da0959ed087d39d397d004a
child 811200 8e5b3793bd8c5e550e68de0608a85e3bb2c2b6a9
child 811348 ad803e927089c9735d0cf1f000b5a50012d440e8
child 811471 23df57f0c579d022a9b37c4599c5a60bfd4c50b8
child 812356 31fbc0d49e1e3392766f9b1978f74de73fcc2844
child 812554 90da40c701cb0f48e6e6dfe28036391011f38e34
child 815075 1dd6410985de69ee0b3ffefeac87a79d3090bbc8
child 815079 f943f5adab1378fa876c22356d656d92c863450c
push id114070
push userbmo:daniel@haxx.se
push dateTue, 26 Jun 2018 09:41:02 +0000
reviewersbaku
bugs1469879
milestone63.0a1
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();
 }