hal: Branch 'master' - 2 commits

Danny Kukawka dkukawka at kemper.freedesktop.org
Mon Nov 26 09:58:00 PST 2007


 hald/device_info.c |    1 +
 hald/ids.h         |   19 ++++++++++++++++---
 2 files changed, 17 insertions(+), 3 deletions(-)

New commits:
commit de3c09abffba4a55bfeea2a1ef7080828d836609
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Mon Nov 26 18:56:53 2007 +0100

    fix possible segfault if compiled without IDs
    
    Fixed possible segfault if HAL get compiled --disable-pci-ids,
    --disable-usb-ids or --disable-pnp-ids.

diff --git a/hald/ids.h b/hald/ids.h
index 7773211..a5d2cbc 100644
--- a/hald/ids.h
+++ b/hald/ids.h
@@ -45,7 +45,13 @@ static inline void
 ids_find_pci (int vendor_id, int product_id,
 	      int subsys_vendor_id, int subsys_product_id,
 	      char **vendor_name, char **product_name,
-	      char **subsys_vendor_name, char **subsys_product_name) {return;}
+	      char **subsys_vendor_name, char **subsys_product_name) {
+	*vendor_name = NULL;
+	*product_name = NULL;
+	*subsys_vendor_name = NULL;
+	*subsys_product_name = NULL;
+	return;
+}
 #endif /*USE_PCI_IDS*/
 
 #ifdef USE_PNP_IDS
@@ -55,7 +61,10 @@ ids_find_pnp (const char *pnp_id, char **pnp_description);
 
 #else /*USE_PNP_IDS*/
 static inline void
-ids_find_pnp (const char *pnp_id, char **pnp_description) {return;}
+ids_find_pnp (const char *pnp_id, char **pnp_description) {
+	*pnp_description = NULL;
+	return;
+}
 #endif /*USE_PNP_IDS*/
 
 #ifdef USE_USB_IDS
@@ -70,7 +79,11 @@ ids_find_usb (int vendor_id, int product_id,
 static inline void usb_ids_init (void) {return;}
 static inline void
 ids_find_usb (int vendor_id, int product_id,
-	      char **vendor_name, char **product_name) {return;}
+	      char **vendor_name, char **product_name) {
+	*vendor_name = NULL;
+	*product_name = NULL;
+	return;
+}
 #endif /*USE_USB_IDS*/
 
 void ids_init (void);
commit 111326d934c783716582eb3d4af1bc992421109c
Author: Danny Kukawka <danny.kukawka at web.de>
Date:   Mon Nov 26 18:52:21 2007 +0100

    fix endless loop on empty match rules in fdi-files
    
    Fixed endless loop on empty fdi (match) rules. Simply jump to the next
    rule if this happen.

diff --git a/hald/device_info.c b/hald/device_info.c
index 438ec52..d601e60 100644
--- a/hald/device_info.c
+++ b/hald/device_info.c
@@ -1109,6 +1109,7 @@ rules_match_and_merge_device (void *fdi_rules_list, HalDevice *d)
 
 		default:
 			HAL_WARNING(("Unhandled rule (%i)!", rule->rtype));
+			rule = di_jump(rule);
 			break;
 		}
 		rule = di_next(rule);


More information about the hal-commit mailing list