[network-manager-applet] editor: fix bad memory access in wsec_size_group_clear()
- From: Beniamino Galvani <bgalvani src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-applet] editor: fix bad memory access in wsec_size_group_clear()
- Date: Wed, 4 Jan 2017 13:45:14 +0000 (UTC)
commit 6b0de82dd52d0f9c7279a0dcae7d4b6a8e0cf5f0
Author: Beniamino Galvani <bgalvani redhat com>
Date: Wed Jan 4 14:25:07 2017 +0100
editor: fix bad memory access in wsec_size_group_clear()
Elements of the list returned by gtk_size_group_get_widgets() become
invalid after the call to gtk_size_group_remove_widget().
src/connection-editor/page-wifi-security.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/connection-editor/page-wifi-security.c b/src/connection-editor/page-wifi-security.c
index 4b366ea..b775aa9 100644
--- a/src/connection-editor/page-wifi-security.c
+++ b/src/connection-editor/page-wifi-security.c
@@ -107,14 +107,15 @@ stuff_changed_cb (WirelessSecurity *sec, gpointer user_data)
static void
wsec_size_group_clear (GtkSizeGroup *group)
{
- GSList *children;
GSList *iter;
g_return_if_fail (group != NULL);
- children = gtk_size_group_get_widgets (group);
- for (iter = children; iter; iter = g_slist_next (iter))
+ iter = gtk_size_group_get_widgets (group);
+ while (iter) {
gtk_size_group_remove_widget (group, GTK_WIDGET (iter->data));
+ iter = gtk_size_group_get_widgets (group);
+ }
}
static WirelessSecurity *
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]