Merge branch '1.1.x'
authorMark Wooding <mdw@distorted.org.uk>
Sun, 14 May 2017 03:28:02 +0000 (04:28 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 14 May 2017 03:28:02 +0000 (04:28 +0100)
* 1.1.x:
  Release 1.1.2.
  catacomb/__init__.py: Fix up cipher etc. names better.
  algorithms.c: Support the new 16-bit key-size descriptors.
  group.c: Track Catacomb group internals change.
  utils.c: Raise exceptions from `convTHING' with null arguments.
  Return `long' objects when `int' is requested but the value won't fit.
  bytestring.c: Check for cached hash more carefully.
  rand.c: Careful range checking on `block' and `mp'.
  *.c: Fix docstrings for methods.
  Further fixing to use `Py_ssize_t' in place of int.

Conflicts:
debian/control (already wanted later catacomb-dev)
group.c (no need for compatibility with older Catacombs)

util.c

diff --git a/util.c b/util.c
index 58d2fe7..d4b7fb0 100644 (file)
--- a/util.c
+++ b/util.c
@@ -83,6 +83,7 @@ int convulong(PyObject *o, void *pp)
   unsigned long *p = pp;
   PyObject *t;
 
+  if (!o) VALERR("can't delete");
   if (PyInt_Check(o)) {
     i = PyInt_AS_LONG(o);
     if (i < 0) VALERR("must be nonnegative");
@@ -176,8 +177,11 @@ end:
 
 int convbool(PyObject *o, void *pp)
 {
+  if (!o) VALERR("can't delete");
   *(int *)pp = PyObject_IsTrue(o);
   return (1);
+end:
+  return (0);
 }
 
 /*----- Type messing ------------------------------------------------------*/