dbus_g_bus_get return value

Havoc Pennington hp at redhat.com
Tue Oct 5 17:12:30 UTC 2004

This is just a bug - the code needs to avoid munging the pointer if the
pointer is NULL. Someone posted a patch I think.


On Tue, 2004-10-05 at 12:16 -0400, Leonardo Boiko wrote:
> Thank you for the help, but I understood the reason for the failure. 
> I'm sorry if I wasn't clear.  My issue is not with the function 
> returning an error, it is with the sample tutorial code not detecting 
> this error.
> If you check for "error != NULL", when there is no session bus, the 
> program will print an error message and abort.  However, it checks for 
> "connection == NULL", which fails because dbus_g_bus_get returned 
> garbage, and the program tries to use the invalid connection.
> -- 
> Leonardo Boiko

More information about the dbus mailing list