[pygobject/pygobject-3-8] Fix stack corruption due to incorrect format for argument parser
- From: Simon Feltman <sfeltman src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygobject/pygobject-3-8] Fix stack corruption due to incorrect format for argument parser
- Date: Sun, 31 Mar 2013 08:47:02 +0000 (UTC)
commit c1fb6516031d3c32abd640f09a4814ae4363f979
Author: Simon Feltman <sfeltman src gnome org>
Date: Sun Mar 31 01:32:34 2013 -0700
Fix stack corruption due to incorrect format for argument parser
Fix call to PyArg_ParseTupleAndKeywords that used a format parser
of "l" meaning long (8 bytes) in combination with an output pointer
of guint (4 bytes). Change to use gulong with a format of "k".
https://bugzilla.gnome.org/show_bug.cgi?id=696892
gi/_gobject/pygflags.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gi/_gobject/pygflags.c b/gi/_gobject/pygflags.c
index 83aa4dc..bdeaae7 100644
--- a/gi/_gobject/pygflags.c
+++ b/gi/_gobject/pygflags.c
@@ -129,12 +129,12 @@ static PyObject *
pyg_flags_new(PyTypeObject *type, PyObject *args, PyObject *kwargs)
{
static char *kwlist[] = { "value", NULL };
- guint value;
+ gulong value;
PyObject *pytc, *values, *ret, *pyint;
GType gtype;
GFlagsClass *eclass;
- if (!PyArg_ParseTupleAndKeywords(args, kwargs, "l", kwlist, &value))
+ if (!PyArg_ParseTupleAndKeywords(args, kwargs, "k", kwlist, &value))
return NULL;
pytc = PyObject_GetAttrString((PyObject *)type, "__gtype__");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]