Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dbus
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 248
    • Issues 248
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • dbus
  • dbus
  • Issues
  • #156

Closed
Open
Created Sep 25, 2016 by Bugzilla Migration User@bugzilla-migration

wid can be used without initialisation in dbus-launch.c

Submitted by René J.V. Bertin

Assigned to D-Bus Maintainers

Link to original bug (#97924)

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

Assignee
Assign to
Time tracking