notificationDaemon: Guard against invalid D-Bus object paths

When making any D-Bus call through the GDBus' proxy wrapper with an
invalid D-Bus object path, gnome-shell hangs.

Supposedly FdoApplicationProxy constructor should validate the passed
D-Bus object path and throw an error if the path is invalid. Since it
does not do that, we work it around by making sure that the deduced
D-Bus object path is valid or throw an exception if the path is not.

https://bugzilla.gnome.org/show_bug.cgi?id=787902
This commit is contained in:
Krzesimir Nowak 2016-11-18 15:52:46 +01:00 committed by Mario Sanchez Prada
parent ce7ff27c0c
commit 1ef8722c52

View File

@ -687,6 +687,8 @@ var GtkNotificationDaemonAppSource = new Lang.Class({
_init: function(appId) { _init: function(appId) {
this._appId = appId; this._appId = appId;
this._objectPath = objectPathFromAppId(appId); this._objectPath = objectPathFromAppId(appId);
if (!GLib.Variant.is_object_path(this._objectPath))
throw new InvalidAppError();
this._app = Shell.AppSystem.get_default().lookup_app(appId + '.desktop'); this._app = Shell.AppSystem.get_default().lookup_app(appId + '.desktop');
if (!this._app) if (!this._app)