Magellan Linux

Annotation of /trunk/hal/patches/hal-0.5.10-fix-possible-segfault-if-compiled-without-IDs.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 597 - (hide annotations) (download)
Mon May 19 19:05:19 2008 UTC (16 years, 1 month ago) by niro
File size: 1757 byte(s)
-gentoo patches

1 niro 597 From b5fe05c15e7ba5321304578318db347c8fbab6fb Mon Sep 17 00:00:00 2001
2     From: Danny Kukawka <danny.kukawka@web.de>
3     Date: Mon, 26 Nov 2007 18:56:53 +0100
4     Subject: [PATCH] fix possible segfault if compiled without IDs
5    
6     Fixed possible segfault if HAL get compiled --disable-pci-ids,
7     --disable-usb-ids or --disable-pnp-ids.
8     ---
9     hald/ids.h | 19 ++++++++++++++++---
10     1 files changed, 16 insertions(+), 3 deletions(-)
11    
12     diff --git a/hald/ids.h b/hald/ids.h
13     index 7773211..a5d2cbc 100644
14     --- a/hald/ids.h
15     +++ b/hald/ids.h
16     @@ -45,7 +45,13 @@ static inline void
17     ids_find_pci (int vendor_id, int product_id,
18     int subsys_vendor_id, int subsys_product_id,
19     char **vendor_name, char **product_name,
20     - char **subsys_vendor_name, char **subsys_product_name) {return;}
21     + char **subsys_vendor_name, char **subsys_product_name) {
22     + *vendor_name = NULL;
23     + *product_name = NULL;
24     + *subsys_vendor_name = NULL;
25     + *subsys_product_name = NULL;
26     + return;
27     +}
28     #endif /*USE_PCI_IDS*/
29    
30     #ifdef USE_PNP_IDS
31     @@ -55,7 +61,10 @@ ids_find_pnp (const char *pnp_id, char **pnp_description);
32    
33     #else /*USE_PNP_IDS*/
34     static inline void
35     -ids_find_pnp (const char *pnp_id, char **pnp_description) {return;}
36     +ids_find_pnp (const char *pnp_id, char **pnp_description) {
37     + *pnp_description = NULL;
38     + return;
39     +}
40     #endif /*USE_PNP_IDS*/
41    
42     #ifdef USE_USB_IDS
43     @@ -70,7 +79,11 @@ ids_find_usb (int vendor_id, int product_id,
44     static inline void usb_ids_init (void) {return;}
45     static inline void
46     ids_find_usb (int vendor_id, int product_id,
47     - char **vendor_name, char **product_name) {return;}
48     + char **vendor_name, char **product_name) {
49     + *vendor_name = NULL;
50     + *product_name = NULL;
51     + return;
52     +}
53     #endif /*USE_USB_IDS*/
54    
55     void ids_init (void);
56     --
57     1.5.3.7
58