Commit c1fb6516 authored by Simon Feltman's avatar Simon Feltman

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".
parent 5f82e007
......@@ -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__");
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment