[pygobject] Fix stack corruption due to incorrect format for argument parser



commit 2259ccac8aa2ec23240e92e303ea3f2c53dc2a88
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]