[xchat-gnome/f16] don't iterate over an empty hash table (#742868, <jklimes at redhat.com>)

Bill Nottingham notting at fedoraproject.org
Tue Oct 4 18:51:27 UTC 2011


commit 7d205ca2149a685e5424372bfd40fa73ad3095cd
Author: Bill Nottingham <notting at redhat.com>
Date:   Tue Oct 4 14:49:16 2011 -0400

    don't iterate over an empty hash table (#742868, <jklimes at redhat.com>)

 0001-Fix-crash-on-NULL-networks-hash-table.patch |   31 ++++++++++++++++++++++
 xchat-gnome.spec                                 |    6 ++++
 2 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/0001-Fix-crash-on-NULL-networks-hash-table.patch b/0001-Fix-crash-on-NULL-networks-hash-table.patch
new file mode 100644
index 0000000..6ea4af6
--- /dev/null
+++ b/0001-Fix-crash-on-NULL-networks-hash-table.patch
@@ -0,0 +1,31 @@
+From 5b79d29146a72f1db0eff3bce4fd8e155d396c2d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= <jklimes at redhat.com>
+Date: Mon, 3 Oct 2011 13:47:27 +0200
+Subject: [PATCH] Fix crash on NULL 'networks' hash table
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+
+Signed-off-by: Jiří Klimeš <jklimes at redhat.com>
+---
+ plugins/net-monitor/net-monitor.c |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/plugins/net-monitor/net-monitor.c b/plugins/net-monitor/net-monitor.c
+index fada61c..6ac981c 100644
+--- a/plugins/net-monitor/net-monitor.c
++++ b/plugins/net-monitor/net-monitor.c
+@@ -176,7 +176,8 @@ set_network_mode (NetworkStatus status)
+ 		 */
+ 		res_init();
+ 
+-		g_hash_table_foreach (networks, (GHFunc) connect_to_network, NULL);
++		if (networks)
++			g_hash_table_foreach (networks, (GHFunc) connect_to_network, NULL);
+ 	}
+ }
+ 
+-- 
+1.7.6.4
+
diff --git a/xchat-gnome.spec b/xchat-gnome.spec
index 3ba0dc3..ca5e9c3 100644
--- a/xchat-gnome.spec
+++ b/xchat-gnome.spec
@@ -32,6 +32,8 @@ Patch101:	0002-Plugin_GetCurrent-can-return-NULL.patch
 Patch102:	0003-Ensure-pixmap-depth-matches-screen-window-depth.patch
 # free(foo); g_slist_remove(list, foo); is bad practice, mmmkay?
 Patch103:	0004-Call-g_slist_remove-on-items-before-free-not-after.patch
+# Don't iterate over an empty hash
+Patch104:	0001-Fix-crash-on-NULL-networks-hash-table.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -83,6 +85,7 @@ common settings will be included in the main user interface. .
 %patch101 -p1 -b .nullplugin
 %patch102 -p1 -b .depth
 %patch103 -p1 -b .free
+%patch104 -p1 -b .hash
 
 %build
 ./autogen.sh
@@ -149,6 +152,9 @@ fi
 
 
 %changelog
+* Tue Oct 04 2011 Bill Nottingham <notting at redhat.com> 0.26.2-4.git40c5bf988
+- don't iterate over an empty hash table (#742868, <jklimes at redhat.com>)
+
 * Wed Jul 20 2011 Petr Sabata <contyk at redhat.com> - 0.26.2-3.git40c5bf988
 - Perl mass rebuild
 


More information about the scm-commits mailing list