hal: Branch 'master'

Danny Kukawka dkukawka at kemper.freedesktop.org
Fri Aug 10 09:16:47 PDT 2007


 hald/linux/device.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

New commits:
diff-tree afcd255ed7dd4729824242f216549c24b5a7a603 (from a8a8333385e54620e928c167172d418abee42c57)
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Fri Aug 10 18:08:26 2007 +0200

    fix possible segfault on serial device check
    
    Applied slightly adopted patch from Natanael Copa <natanael.copa at gmail.com>:
    > The problem is that serial_get_prober() dont check if
    > hal_device_property_get_string() returns NULL or not.

diff --git a/hald/linux/device.c b/hald/linux/device.c
index 45cd25b..c6e9942 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -1333,9 +1333,12 @@ out:
 static const gchar *
 serial_get_prober (HalDevice *d)
 {
+	char *dev;
+
 	/* FIXME TODO: check if there is an other way, to call the porber only
-		 on ttyS* devices, than check the name of the device file */
-	if (!strncmp(hal_device_property_get_string (d, "linux.device_file"), "/dev/ttyS", 9))
+		       on ttyS* devices, than check the name of the device file */
+	dev  = hal_device_property_get_string (d, "linux.device_file");
+	if (dev && !strncmp(dev, "/dev/ttyS", 9))
 		return "hald-probe-serial";
 	else 
 		return NULL;


More information about the hal-commit mailing list