Bug 1477037 - Add NULL check on aArgv. r=froydnj
authorJan Andre Ikenmeyer [:darkspirit] <jan@ikenmeyer.eu>
Sat, 01 Dec 2018 02:08:42 +0100
changeset 508368 427accad16ae157eebbe24f95f64812ada65304a
parent 508367 870d4a920aed8fe2251be8f81d824384d71ce38e
child 508369 3a943b45881a477872f02fe7a601e838cb233f42
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1477037
milestone65.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 1477037 - Add NULL check on aArgv. r=froydnj
dom/media/ipc/RDDProcessImpl.cpp
gfx/ipc/GPUProcessImpl.cpp
gfx/vr/ipc/VRProcessChild.cpp
--- a/dom/media/ipc/RDDProcessImpl.cpp
+++ b/dom/media/ipc/RDDProcessImpl.cpp
@@ -21,16 +21,19 @@ RDDProcessImpl::RDDProcessImpl(ProcessId
 RDDProcessImpl::~RDDProcessImpl() {}
 
 bool RDDProcessImpl::Init(int aArgc, char* aArgv[]) {
 #if defined(MOZ_SANDBOX) && defined(OS_WIN)
   mozilla::SandboxTarget::Instance()->StartSandbox();
 #endif
   char* parentBuildID = nullptr;
   for (int i = 1; i < aArgc; i++) {
+    if (!aArgv[i]) {
+      continue;
+    }
     if (strcmp(aArgv[i], "-parentBuildID") == 0) {
       parentBuildID = aArgv[i + 1];
     }
   }
 
   return mRDD.Init(ParentPid(), parentBuildID, IOThreadChild::message_loop(),
                    IOThreadChild::channel());
 }
--- a/gfx/ipc/GPUProcessImpl.cpp
+++ b/gfx/ipc/GPUProcessImpl.cpp
@@ -22,16 +22,19 @@ GPUProcessImpl::GPUProcessImpl(ProcessId
 GPUProcessImpl::~GPUProcessImpl() {}
 
 bool GPUProcessImpl::Init(int aArgc, char* aArgv[]) {
 #if defined(MOZ_SANDBOX) && defined(OS_WIN)
   mozilla::SandboxTarget::Instance()->StartSandbox();
 #endif
   char* parentBuildID = nullptr;
   for (int i = 1; i < aArgc; i++) {
+    if (!aArgv[i]) {
+      continue;
+    }
     if (strcmp(aArgv[i], "-parentBuildID") == 0) {
       parentBuildID = aArgv[i + 1];
     }
   }
 
   return mGPU.Init(ParentPid(), parentBuildID, IOThreadChild::message_loop(),
                    IOThreadChild::channel());
 }
--- a/gfx/vr/ipc/VRProcessChild.cpp
+++ b/gfx/vr/ipc/VRProcessChild.cpp
@@ -24,16 +24,19 @@ VRProcessChild::VRProcessChild(ProcessId
 
 VRProcessChild::~VRProcessChild() {}
 
 bool VRProcessChild::Init(int aArgc, char* aArgv[]) {
   BackgroundHangMonitor::Startup();
 
   char* parentBuildID = nullptr;
   for (int i = 1; i < aArgc; i++) {
+    if (!aArgv[i]) {
+      continue;
+    }
     if (strcmp(aArgv[i], "-parentBuildID") == 0) {
       parentBuildID = aArgv[i + 1];
     }
   }
 
   mVR.Init(ParentPid(), parentBuildID, IOThreadChild::message_loop(),
            IOThreadChild::channel());