Bug 1684365 - Add a null pointer check so that Firefox won't crash when it can't initialize mRemoteServer r=stransky

Firefox 84.0.1 crashes under Gentoo Linux if it is started in
Wayland mode and if it was compiled WITH Wayland support and
WITHOUT dbus support.

I traced down the problem to line 172 of
toolkit/components/remote/nsRemoteService.cpp:

   nsresult rv = mRemoteServer->Startup(mProgram.get(), mProfile.get());

mRemoteServer is NULL and Firefox crashes.

This patch adds a NULL pointer check before that line.

See:
- Mozilla's Bugzilla, bug 1684365
- https://bugs.gentoo.org/762035
- https://forums.gentoo.org/viewtopic-t-1126235.html

Differential Revision: https://phabricator.services.mozilla.com/D101536
This commit is contained in:
Michael Hofmann 2021-01-25 09:29:42 +00:00
parent e18a0436b9
commit 99540873a3

View File

@ -170,6 +170,10 @@ void nsRemoteService::StartupServer() {
return;
#endif
if (!mRemoteServer) {
return;
}
nsresult rv = mRemoteServer->Startup(mProgram.get(), mProfile.get());
if (NS_FAILED(rv)) {