Bug 1270247 - Crash in ParamTraits<mozilla::net::NetAddr>::Write if the family is unknown. r=hurley
authorAndrew McCreight <continuation@gmail.com>
Wed, 04 May 2016 14:49:16 -0700
changeset 296142 b9482cba39f34ac1fb886a3e73c9b2f991645620
parent 296141 5fa2e1397aca364125bb7859414a7af2244d4f30
child 296143 e930d26502a6cae04fe86939637d0348a86fcf10
push id76218
push useramccreight@mozilla.com
push dateWed, 04 May 2016 21:49:28 +0000
treeherdermozilla-inbound@b9482cba39f3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershurley
bugs1270247
milestone49.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1270247 - Crash in ParamTraits<mozilla::net::NetAddr>::Write if the family is unknown. r=hurley This will prevent mysterious deserialization crashes in the receiver.
netwerk/ipc/NeckoMessageUtils.h
--- a/netwerk/ipc/NeckoMessageUtils.h
+++ b/netwerk/ipc/NeckoMessageUtils.h
@@ -91,20 +91,19 @@ struct ParamTraits<mozilla::net::NetAddr
       WriteParam(aMsg, aParam.inet6.scope_id);
 #if defined(XP_UNIX)
     } else if (aParam.raw.family == AF_LOCAL) {
       // Train's already off the rails:  let's get a stack trace at least...
       NS_RUNTIMEABORT("Error: please post stack trace to "
                       "https://bugzilla.mozilla.org/show_bug.cgi?id=661158");
       aMsg->WriteBytes(aParam.local.path, sizeof(aParam.local.path));
 #endif
+    } else {
+      NS_RUNTIMEABORT("Unknown socket family");
     }
-
-    /* If we get here without hitting any of the cases above, there's not much
-     * we can do but let the deserializer fail when it gets this message */
   }
 
   static bool Read(const Message* aMsg, void** aIter, mozilla::net::NetAddr* aResult)
   {
     if (!ReadParam(aMsg, aIter, &aResult->raw.family))
       return false;
 
     if (aResult->raw.family == AF_UNSPEC) {