Magellan Linux

Contents of /trunk/hal/patches/hal-0.5.10-fix-uninitialised-memory-usage-in-pci_add.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 597 - (show annotations) (download)
Mon May 19 19:05:19 2008 UTC (15 years, 11 months ago) by niro
File size: 1097 byte(s)
-gentoo patches

1 From 6ccf2d2376e4472d9210d75cf3a0634fd785bb65 Mon Sep 17 00:00:00 2001
2 From: Rob Taylor <rob.taylor@codethink.co.uk>
3 Date: Thu, 8 Nov 2007 23:51:47 +0000
4 Subject: [PATCH] fix uninitialised memory usage in pci_add
5
6 pci_add was using vendor_name, product_name, subsys_vendor_name and
7 subsys_product_name unitialised, causing random crashes and garbage output.
8 ---
9 hald/linux/device.c | 8 ++++----
10 1 files changed, 4 insertions(+), 4 deletions(-)
11
12 diff --git a/hald/linux/device.c b/hald/linux/device.c
13 index 8cc12ef..dc955c6 100644
14 --- a/hald/linux/device.c
15 +++ b/hald/linux/device.c
16 @@ -1548,10 +1548,10 @@ pci_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_de
17
18 {
19 gchar buf[64];
20 - char *vendor_name;
21 - char *product_name;
22 - char *subsys_vendor_name;
23 - char *subsys_product_name;
24 + char *vendor_name = NULL;
25 + char *product_name = NULL;
26 + char *subsys_vendor_name = NULL;
27 + char *subsys_product_name = NULL;
28
29 ids_find_pci (hal_device_property_get_int (d, "pci.vendor_id"),
30 hal_device_property_get_int (d, "pci.product_id"),
31 --
32 1.5.3.7
33