Bug#318031: segfault on amd64
Aurelien Jacobs
Aurelien Jacobs <aurel@gnuage.org>, 318031@bugs.debian.org
Tue Jul 12 23:52:01 UTC 2005
--Multipart_Wed__13_Jul_2005_01_52_01_+0200_ce7JTr/arUa9ZVNh
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Package: libgksu1.2
Version: 1.3.1-1
Severity: important
Tags: patch
Currently, libgksu defines a callback function (keyring_create_item_cb)
inside another function. The problem is that this callback function
is stored on the stack (like any other local variable). amd64 has this
famous NX flag which prevent execution of the stack. So when the
callback stored on the stack is called, it simply segfault.
The fix is very simple: move keyring_create_item_cb callback definition
outside of the function.
The attached patch fix this issue.
BTW: this patch should also close #307975
Aurel
--Multipart_Wed__13_Jul_2005_01_52_01_+0200_ce7JTr/arUa9ZVNh
Content-Type: text/plain; name=libgksu-amd64.diff
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=libgksu-amd64.diff
--- libgksu/gksu-context.c.orig 2005-07-13 01:29:24.000000000 +0200
+++ libgksu/gksu-context.c 2005-07-13 01:30:36.000000000 +0200
@@ -784,6 +784,13 @@
return TRUE;
}
+static void
+keyring_create_item_cb (GnomeKeyringResult result,
+ guint32 id, gpointer keyring_loop)
+{
+ g_main_loop_quit (keyring_loop);
+}
+
/**
* gksu_context_run:
* @context: a #GksuContext
@@ -989,20 +996,14 @@
keyring_loop = g_main_loop_new (NULL, FALSE);
- void
- keyring_create_item_cb (GnomeKeyringResult result,
- guint32 id, gpointer data)
- {
- g_main_loop_quit (keyring_loop);
- }
-
gnome_keyring_item_create (NULL,
GNOME_KEYRING_ITEM_GENERIC_SECRET,
key_name,
attributes,
gksu_context_get_password (context),
TRUE,
- keyring_create_item_cb, NULL, NULL);
+ keyring_create_item_cb,
+ keyring_loop, NULL);
gnome_keyring_attribute_list_free (attributes);
g_main_loop_run (keyring_loop);
}
--Multipart_Wed__13_Jul_2005_01_52_01_+0200_ce7JTr/arUa9ZVNh--
More information about the Pkg-gnome-maintainers
mailing list