[Pkg-utopia-commits] r1874 - in /packages/unstable/hal/debian: changelog patches/82_partutil_dont_deref_null.patch patches/83_crash_if_singleton_hashtable_is_null.patch patches/84_fix_uninitialised_memory_usage_in_pci_add.patch

sjoerd at users.alioth.debian.org sjoerd at users.alioth.debian.org
Sun Nov 25 12:14:47 UTC 2007


Author: sjoerd
Date: Sun Nov 25 12:14:47 2007
New Revision: 1874

URL: http://svn.debian.org/wsvn/pkg-utopia/?sc=1&rev=1874
Log:
* debian/patches/82_partutil_dont_deref_null.patch
  - Added. Fixes partutils to not deref a pointer before checking it's not
  NULL (from upstream git)

Added:
    packages/unstable/hal/debian/patches/82_partutil_dont_deref_null.patch
    packages/unstable/hal/debian/patches/83_crash_if_singleton_hashtable_is_null.patch
    packages/unstable/hal/debian/patches/84_fix_uninitialised_memory_usage_in_pci_add.patch
Modified:
    packages/unstable/hal/debian/changelog

Modified: packages/unstable/hal/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/hal/debian/changelog?rev=1874&op=diff
==============================================================================
--- packages/unstable/hal/debian/changelog (original)
+++ packages/unstable/hal/debian/changelog Sun Nov 25 12:14:47 2007
@@ -14,6 +14,9 @@
   * debian/patches/81_dont_deref_reason_why_locked_if_null.patch
     - Added. If dbus_malloc0 failed (returned NULL), don't deref the NULL
     pointer. (from upstream git)
+  * debian/patches/82_partutil_dont_deref_null.patch
+    - Added. Fixes partutils to not deref a pointer before checking it's not
+    NULL (from upstream git)
 
  -- Michael Biebl <biebl at debian.org>  Wed, 24 Oct 2007 16:19:33 +0200
 

Added: packages/unstable/hal/debian/patches/82_partutil_dont_deref_null.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/hal/debian/patches/82_partutil_dont_deref_null.patch?rev=1874&op=file
==============================================================================
--- packages/unstable/hal/debian/patches/82_partutil_dont_deref_null.patch (added)
+++ packages/unstable/hal/debian/patches/82_partutil_dont_deref_null.patch Sun Nov 25 12:14:47 2007
@@ -1,0 +1,105 @@
+commit 7f414a36784efa0dbef3a337518dc3cd3a1d7b4a
+Author: Guillem Jover <guillem.jover at nokia.com>
+Date:   Tue Nov 20 15:00:29 2007 +0100
+
+    dereference pointer after checking it's not NULL
+    
+    Dereference pointer after checking it's not NULL in
+    partutil/partutil.c.
+
+diff --git a/partutil/partutil.c b/partutil/partutil.c
+index 36078c0..b22f9b2 100644
+--- a/partutil/partutil.c
++++ b/partutil/partutil.c
+@@ -928,11 +928,13 @@ char *
+ part_table_entry_get_type (PartitionTable *p, int entry)
+ {
+ 	char *s = NULL;
+-	PartitionEntry *pe = g_slist_nth_data (p->entries, entry);
++	PartitionEntry *pe;
+ 
+ 	if (p == NULL)
+ 		goto out;
+ 
++	pe = g_slist_nth_data (p->entries, entry);
++
+ 	switch (p->scheme) {
+ 	case PART_TYPE_GPT:
+ 		s = get_le_guid (&(pe->data[0]));
+@@ -959,11 +961,13 @@ char *
+ part_table_entry_get_uuid (PartitionTable *p, int entry)
+ {
+ 	char *s = NULL;
+-	PartitionEntry *pe = g_slist_nth_data (p->entries, entry);
++	PartitionEntry *pe;
+ 
+ 	if (p == NULL)
+ 		goto out;
+ 
++	pe = g_slist_nth_data (p->entries, entry);
++
+ 	switch (p->scheme) {
+ 	case PART_TYPE_GPT:
+ 		s = get_le_guid (&(pe->data[16]));
+@@ -982,11 +986,13 @@ char *
+ part_table_entry_get_label (PartitionTable *p, int entry)
+ {
+ 	char *s = NULL;
+-	PartitionEntry *pe = g_slist_nth_data (p->entries, entry);
++	PartitionEntry *pe;
+ 
+ 	if (p == NULL)
+ 		goto out;
+ 
++	pe = g_slist_nth_data (p->entries, entry);
++
+ 	switch (p->scheme) {
+ 	case PART_TYPE_GPT:
+ 		s = g_utf16_to_utf8 ((const gunichar2 *) &(pe->data[56]), 36, NULL, NULL, NULL);
+@@ -1012,11 +1018,13 @@ part_table_entry_get_flags (PartitionTable *p, int entry)
+ 	char **ss = NULL;
+ 	guint32 apm_status;
+ 	guint64 gpt_attributes;
+-	PartitionEntry *pe = g_slist_nth_data (p->entries, entry);
++	PartitionEntry *pe;
+ 
+ 	if (p == NULL)
+ 		goto out;
+ 
++	pe = g_slist_nth_data (p->entries, entry);
++
+ 	ss = g_new0 (char*, 6 + 1); /* hard coded to max items we'll return */
+ 	ss[0] = NULL;
+ 	n = 0;
+@@ -1087,12 +1095,14 @@ guint64
+ part_table_entry_get_offset (PartitionTable *p, int entry)
+ {
+ 	guint64 val;
+-	PartitionEntry *pe = g_slist_nth_data (p->entries, entry);
++	PartitionEntry *pe;
+ 
+ 	val = G_MAXUINT64;
+ 	if (p == NULL)
+ 		goto out;
+ 
++	pe = g_slist_nth_data (p->entries, entry);
++
+ 	switch (p->scheme) {
+ 	case PART_TYPE_GPT:
+ 		val = 0x200 * ((guint64) get_le64 (pe->data + 32));
+@@ -1122,12 +1132,14 @@ guint64
+ part_table_entry_get_size (PartitionTable *p, int entry)
+ {
+ 	guint64 val;
+-	PartitionEntry *pe = g_slist_nth_data (p->entries, entry);
++	PartitionEntry *pe;
+ 
+ 	val = G_MAXUINT64;
+ 	if (p == NULL)
+ 		goto out;
+ 
++	pe = g_slist_nth_data (p->entries, entry);
++
+ 	switch (p->scheme) {
+ 	case PART_TYPE_GPT:
+ 		val = 0x200 * (((guint64) get_le64 (pe->data + 40)) - ((guint64) get_le64 (pe->data + 32)) + 1);

Added: packages/unstable/hal/debian/patches/83_crash_if_singleton_hashtable_is_null.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/hal/debian/patches/83_crash_if_singleton_hashtable_is_null.patch?rev=1874&op=file
==============================================================================
--- packages/unstable/hal/debian/patches/83_crash_if_singleton_hashtable_is_null.patch (added)
+++ packages/unstable/hal/debian/patches/83_crash_if_singleton_hashtable_is_null.patch Sun Nov 25 12:14:47 2007
@@ -1,0 +1,28 @@
+commit 1f2b6056107295031c3a425bc0aac76d11e56bea
+Author: Danny Kukawka <danny.kukawka at web.de>
+Date:   Fri Nov 23 16:57:58 2007 +0100
+
+    fix possible segfault if singletons is NULL
+    
+    Fixed segfault if the singletons Hashtable is NULL. This should
+    fix fd.o bug 11767 and 12287.
+
+diff --git a/hald/hald_dbus.c b/hald/hald_dbus.c
+index 091cc89..ae37d9d 100644
+--- a/hald/hald_dbus.c
++++ b/hald/hald_dbus.c
+@@ -5200,8 +5200,12 @@ local_server_message_handler (DBusConnection *connection,
+ 				helper_interface_handlers = g_slist_remove_link (helper_interface_handlers, i);
+ 			}
+ 		}
+-
+-		g_hash_table_foreach_remove (singletons, (GHRFunc) singleton_remove_by_connection, connection);
++	
++		if (G_UNLIKELY (!singletons)) {
++			HAL_ERROR (("Singleton table is not initialied/ is NULL"));
++		} else {
++			g_hash_table_foreach_remove (singletons, (GHRFunc) singleton_remove_by_connection, connection);
++		}
+ 
+ 		dbus_connection_unref (connection);
+ 		return DBUS_HANDLER_RESULT_HANDLED;

Added: packages/unstable/hal/debian/patches/84_fix_uninitialised_memory_usage_in_pci_add.patch
URL: http://svn.debian.org/wsvn/pkg-utopia/packages/unstable/hal/debian/patches/84_fix_uninitialised_memory_usage_in_pci_add.patch?rev=1874&op=file
==============================================================================
--- packages/unstable/hal/debian/patches/84_fix_uninitialised_memory_usage_in_pci_add.patch (added)
+++ packages/unstable/hal/debian/patches/84_fix_uninitialised_memory_usage_in_pci_add.patch Sun Nov 25 12:14:47 2007
@@ -1,0 +1,34 @@
+>From e253734c381bcc5c09c2122ed434fa1df5bcdd1a Mon Sep 17 00:00:00 2001
+From: Rob Taylor <rob.taylor at codethink.co.uk>
+Date: Thu, 8 Nov 2007 23:51:47 +0000
+Subject: [PATCH] fix uninitialised memory usage in pci_add
+To: hal <hal at lists.freedesktop.org>
+
+pci_add was using vendor_name, product_name, subsys_vendor_name and
+subsys_product_name unitialised, causing random crashes and garbage output.
+---
+ hald/linux/device.c |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/hald/linux/device.c b/hald/linux/device.c
+index 7111629..32063bd 100644
+--- a/hald/linux/device.c
++++ b/hald/linux/device.c
+@@ -1551,10 +1551,10 @@ pci_add (const gchar *sysfs_path, const gchar *device_file, HalDevice *parent_de
+ 
+ 	{
+ 		gchar buf[64];
+-		char *vendor_name;
+-		char *product_name;
+-		char *subsys_vendor_name;
+-		char *subsys_product_name;
++		char *vendor_name = NULL;
++		char *product_name = NULL;
++		char *subsys_vendor_name = NULL;
++		char *subsys_product_name = NULL;
+ 
+ 		ids_find_pci (hal_device_property_get_int (d, "pci.vendor_id"), 
+ 			      hal_device_property_get_int (d, "pci.product_id"), 
+-- 
+1.5.3.GIT
+




More information about the Pkg-utopia-commits mailing list