diff options
author | Michael Schroeder <mls@novell.com> | 2010-08-23 16:13:13 +0200 |
---|---|---|
committer | Danny Kukawka <danny.kukawka@web.de> | 2011-07-14 10:23:30 +0200 |
commit | 794a9bb690d689a04f36b4fabdb25c212b070815 (patch) | |
tree | f2d26cbccae06b923b6b05876f62003aea9c67bf | |
parent | 61b757a7055e017a2cb7b8360b56f38f8b715f8a (diff) |
fix hal segfault
Fixed hal segfault. It crashes because strlen() gets called with a
NULL pointer (ppdev_compute_udi calls hal_util_get_last_element
with a NULL pointer).
bnc#556485
-rw-r--r-- | hald/linux/device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/hald/linux/device.c b/hald/linux/device.c index 0a387964..61ffc629 100644 --- a/hald/linux/device.c +++ b/hald/linux/device.c @@ -2304,9 +2304,10 @@ ppdev_compute_udi (HalDevice *d) gchar udi[256]; const char *name; - name = hal_util_get_last_element( hal_device_property_get_string(d, "linux.device_file")); + name = hal_device_property_get_string (d, "linux.device_file"); if (name) { + name = hal_util_get_last_element (name); hald_compute_udi (udi, sizeof (udi), "/org/freedesktop/Hal/devices/ppdev_%s", name); } else { hald_compute_udi (udi, sizeof (udi), "/org/freedesktop/Hal/devices/ppdev"); |