Mailinglist Archive: opensuse-bugs (14787 mails)

< Previous Next >
[Bug 219356] suseplugger crashes with dbus error
  • From: bugzilla_noreply@xxxxxxxxxx
  • Date: Mon, 13 Nov 2006 10:31:49 -0700 (MST)
  • Message-id: <20061113173149.CAD66F28@xxxxxxxxxxxxxxxxxxxxxx>
https://bugzilla.novell.com/show_bug.cgi?id=219356


wstephenson@xxxxxxxxxx changed:

What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|coolo@xxxxxxxxxx |wstephenson@xxxxxxxxxx




------- Comment #32 from wstephenson@xxxxxxxxxx 2006-11-13 10:31 MST -------
QString libhal_device_get_property_QString(LibHalContext *ctx, const char* udi,
const char *key)
{
if (udi == 0 || !strlen(udi))
return QString();
Danny: As you can see, we do check for a null returned from
libhal_device_get_property_string, but it still crashes unless we check for the
existence of the property first. I could put that check into
libhal_device_get_property_QString() but this causes another dbus roundtrip,
right? If I can do the lightweight check ( 1. in #26 ) I would prefer this.

Is your second suggestion actually the only way to do this safely, or is the
assert in dbus when getting unknown properties really that aggressive?

CODE:
char* _ppt_string;
QString _ppt_QString;
DBusError error;
_ppt_string = libhal_device_get_property_string(ctx, udi, key, &error);
if (_ppt_string)
_ppt_QString = _ppt_string;
libhal_free_string(_ppt_string);
return _ppt_QString;
}


--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

< Previous Next >
References