mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1418770 - Truncate DBus names used for remote service to DBUS_MAXIMUM_NAME_LENGTH, r=jhorak
MozReview-Commit-ID: 3Hrt3Ef87WD --HG-- extra : rebase_source : 9ece42adec435b244f5875f7e3449f6268c0beea
This commit is contained in:
parent
72413786ab
commit
9c4741153c
@ -186,6 +186,9 @@ nsDBusRemoteService::Startup(const char* aAppName, const char* aProfileName)
|
||||
nsAutoCString busName;
|
||||
busName = nsPrintfCString("org.mozilla.%s.%s", mAppName.get(),
|
||||
profileName.get());
|
||||
if (busName.Length() > DBUS_MAXIMUM_NAME_LENGTH)
|
||||
busName.Truncate(DBUS_MAXIMUM_NAME_LENGTH);
|
||||
|
||||
DBusError err;
|
||||
dbus_error_init(&err);
|
||||
dbus_bus_request_name(mConnection, busName.get(),
|
||||
|
@ -133,6 +133,9 @@ DBusRemoteClient::GetRemoteDestinationName(const char *aProgram,
|
||||
|
||||
aDestinationName = nsPrintfCString("org.mozilla.%s.%s", aProgram,
|
||||
profileName.get());
|
||||
if (aDestinationName.Length() > DBUS_MAXIMUM_NAME_LENGTH)
|
||||
aDestinationName.Truncate(DBUS_MAXIMUM_NAME_LENGTH);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user