From: Mark Wooding Date: Sat, 28 Jan 2006 19:31:46 +0000 (+0000) Subject: ec, group: Bug squashing. X-Git-Tag: 1.0.1~33 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/catacomb-python/commitdiff_plain/5f959e502e3ceea40fb3c44593e090417fa11fc9?ds=sidebyside ec, group: Bug squashing. * eccurve_pynew had a bad argument format string, which caused a segfault. * fginfo_pynew also had bogus argument parsing, found in sweep for similar bugs. * ECCurve.pt hadn't been fixed since curves became types. Now done. --- diff --git a/catacomb/__init__.py b/catacomb/__init__.py index 8b1d0ef..105e043 100644 --- a/catacomb/__init__.py +++ b/catacomb/__init__.py @@ -159,7 +159,7 @@ class _tmp: def fromraw(me, s): return ecpt.fromraw(me, s) def pt(me, *args): - return ECPt(me, *args) + return me(*args) _augment(ECCurve, _tmp) class _tmp: diff --git a/ec.c b/ec.c index a64ae45..dab6dfe 100644 --- a/ec.c +++ b/ec.c @@ -948,7 +948,7 @@ static PyObject *eccurve_pynew(PyTypeObject *ty, char *kwlist[] = { "field", "a", "b", 0 }; mp *aa = 0, *bb = 0; - if (!PyArg_ParseTupleAndKeywords(arg, kw, "O!OO", kwlist, + if (!PyArg_ParseTupleAndKeywords(arg, kw, "O!O&O&", kwlist, field_pytype, &fobj, convmp, &aa, convmp, &bb)) goto end; diff --git a/group.c b/group.c index 76dde77..d9c232b 100644 --- a/group.c +++ b/group.c @@ -51,7 +51,7 @@ static PyObject *fginfo_pynew(PyTypeObject *ty, if (!PyArg_ParseTupleAndKeywords(arg, kw, "O&O&O&:new", kwlist, convmp, &dp.p, convmp, &dp.q, - &convmp, dp.g)) + convmp, &dp.g)) goto end; z = PyObject_New(fginfo_pyobj, ty); z->dp = dp;