chiark / gitweb /
ec, group: Bug squashing.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 28 Jan 2006 19:31:46 +0000 (19:31 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 28 Jan 2006 19:31:46 +0000 (19:31 +0000)
  * 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.

catacomb/__init__.py
ec.c
group.c

index 8b1d0ef12a96dfbf76d4c8ff328f1ae26981971e..105e0438918d8ec95820aeb32d5d81ae26b572c7 100644 (file)
@@ -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 a64ae45d4be526b6aa066afbebb160af01e64e45..dab6dfe600666fcb3c2833b43a1cae747ca710f1 100644 (file)
--- 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 76dde7766e4dc41b8c9aa47132978e77b701814c..d9c232b7bc7fe16ea9d4a45ddf234a59847cb108 100644 (file)
--- 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;