Bug 1529498 - null pointer writes in mozilla::net::Predictor::LearnNative, r=valentin
authorMichal Novotny <michal.novotny>
Thu, 21 Feb 2019 04:16:00 +0200
changeset 460376 21dcc5f55dca9153a32c89dd0f000d5add8ebdfd
parent 460375 d4d8f0d1f542d7e7b9bd148db416ed258d7b07ba
child 460377 eed1098d0d6c9e3af5b02154295e452c6c21bb48
push id112083
push userncsoregi@mozilla.com
push dateFri, 22 Feb 2019 02:49:31 +0000
treeherdermozilla-inbound@21dcc5f55dca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1529498
milestone67.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 1529498 - null pointer writes in mozilla::net::Predictor::LearnNative, r=valentin Make sure necko child is initialized before using gNeckoChild in the child process.
netwerk/base/Predictor.cpp
--- a/netwerk/base/Predictor.cpp
+++ b/netwerk/base/Predictor.cpp
@@ -602,16 +602,18 @@ nsresult Predictor::Create(nsISupports *
   nsresult rv;
 
   if (aOuter != nullptr) {
     return NS_ERROR_NO_AGGREGATION;
   }
 
   RefPtr<Predictor> svc = new Predictor();
   if (IsNeckoChild()) {
+    NeckoChild::InitNeckoChild();
+
     // Child threads only need to be call into the public interface methods
     // so we don't bother with initialization
     return svc->QueryInterface(aIID, aResult);
   }
 
   rv = svc->Init();
   if (NS_FAILED(rv)) {
     PREDICTOR_LOG(("Failed to initialize predictor, predictor will be a noop"));