From: Mark Wooding Date: Thu, 26 May 2016 08:26:09 +0000 (+0100) Subject: algorithms.c: Set required size on GMAC objects. X-Git-Tag: 1.2.0~51 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/commitdiff_plain/828b13882f35b28275cf4062296b0419e0f0a7d1?hp=35e5469a15e4f97b0fc0ecf70840b22e0bc0b1c2 algorithms.c: Set required size on GMAC objects. The Python interpreter catches this in debug mode. Also, it's really bad. --- diff --git a/algorithms.c b/algorithms.c index 4753cf0..60cfd58 100644 --- a/algorithms.c +++ b/algorithms.c @@ -996,6 +996,7 @@ PyObject *gmac_pywrap(PyObject *cobj, gmac *m, unsigned f) if (!cobj) cobj = gcmac_pywrap((/*unconst*/ gcmac *)GM_CLASS(m)); else Py_INCREF(cobj); g = newtype((PyTypeObject *)cobj, 0, 0); + g->ty.ht_type.tp_basicsize = sizeof(ghash_pyobj); g->ty.ht_name = PyString_FromFormat("%s(keyed)", m->ops->c->name); g->ty.ht_type.tp_name = PyString_AS_STRING(g->ty.ht_name); g->ty.ht_type.tp_base = gmhash_pytype;