wid can be used without initialisation in dbus-launch.c
Submitted by René J.V. Bertin
Assigned to D-Bus Maintainers
Description
Going over the code I after noticing that dbus-launch set DBUS_SESSION_BUS_WINDOWID to an invalid wid, I see that the wid variable can indeed be used without having been initialised.
IMHO, either dbus-launch.c should initialise the wid variable to 0 at declaration, or x11_get_address() should be modified as such:
diff --git a/tools/dbus-launch-x11.c b/tools/dbus-launch-x11.c index a09444b..d79b4a7 100644 --- a/tools/dbus-launch-x11.c +++ b/tools/dbus-launch-x11.c @@ -305,10 +305,10 @@ x11_get_address (char **paddress, pid_t *pid, long *wid)
/* locate the selection owner */ owner = XGetSelectionOwner (xdisplay, selection_atom);
- if (owner == None)
- return TRUE; /* no owner */ if (wid != NULL) *wid = (long) owner;
- if (owner == None)
- return TRUE; /* no owner */
/* get the bus address */ result = XGetWindowProperty (xdisplay, owner, address_atom, 0, 1024, False,
Version: git master