Bug 1429021 - Don't try to start DBus service without any application/profile name, r=jhorak
authorMartin Stransky <stransky@redhat.com>
Tue, 09 Jan 2018 13:56:12 +0100
changeset 453260 ed6f1ea151c1eb56e2d45da039e7694bce70f32a
parent 453259 83acad9bf47b7c32947d37f03e60622722c1fd88
child 453261 74e94759584cda78f2c715bbb8a5c3ab1c524e37
push id1648
push usermtabara@mozilla.com
push dateThu, 01 Mar 2018 12:45:47 +0000
treeherdermozilla-release@cbb9688c2eeb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjhorak
bugs1429021
milestone59.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 1429021 - Don't try to start DBus service without any application/profile name, r=jhorak MozReview-Commit-ID: 97jawSNNp3i
toolkit/components/remote/nsDBusRemoteService.cpp
--- a/toolkit/components/remote/nsDBusRemoteService.cpp
+++ b/toolkit/components/remote/nsDBusRemoteService.cpp
@@ -152,17 +152,19 @@ static DBusObjectPathVTable remoteHandle
 NS_IMETHODIMP
 nsDBusRemoteService::Startup(const char* aAppName, const char* aProfileName)
 {
   if (mConnection && dbus_connection_get_is_connected(mConnection)) {
     // We're already connected so we don't need to reconnect
     return NS_ERROR_ALREADY_INITIALIZED;
   }
 
-  if (!aAppName || !aProfileName)
+  // Don't even try to start without any application/profile name
+  if (!aAppName || aAppName[0] == '\0' ||
+      !aProfileName || aProfileName[0] == '\0')
     return NS_ERROR_INVALID_ARG;
 
   mConnection = already_AddRefed<DBusConnection>(
     dbus_bus_get(DBUS_BUS_SESSION, nullptr));
   if (!mConnection) {
     return NS_ERROR_FAILURE;
   }
   dbus_connection_set_exit_on_disconnect(mConnection, false);