From 828b13882f35b28275cf4062296b0419e0f0a7d1 Mon Sep 17 00:00:00 2001 Message-Id: <828b13882f35b28275cf4062296b0419e0f0a7d1.1715969753.git.mdw@distorted.org.uk> From: Mark Wooding Date: Thu, 26 May 2016 09:26:09 +0100 Subject: [PATCH] algorithms.c: Set required size on GMAC objects. Organization: Straylight/Edgeware From: Mark Wooding The Python interpreter catches this in debug mode. Also, it's really bad. --- algorithms.c | 1 + 1 file changed, 1 insertion(+) 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; -- [mdw]