key.c, pgen.c: Add missing guards for `del' to property `set' functions.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 19 Oct 2019 17:19:07 +0000 (18:19 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 19 Oct 2019 18:53:34 +0000 (19:53 +0100)
key.c
pgen.c

diff --git a/key.c b/key.c
index a3cd200..e3b5a62 100644 (file)
--- a/key.c
+++ b/key.c
@@ -1497,6 +1497,7 @@ static int kset_exptime(PyObject *me, PyObject *x, void *hunoz)
   key *k = KEY_K(me);
   unsigned long et;
 
+  if (!x) NIERR("__del__");
   if (!convulong(x, &et))
     goto end;
   if (!(KEY_KF(me)->f & KF_WRITE))
@@ -1513,6 +1514,7 @@ static int kset_deltime(PyObject *me, PyObject *x, void *hunoz)
   key *k = KEY_K(me);
   unsigned long dt;
 
+  if (!x) NIERR("__del__");
   if (!convulong(x, &dt))
     goto end;
   if (dt == KEXP_FOREVER && k->exp != KEXP_FOREVER)
diff --git a/pgen.c b/pgen.c
index 108fa31..30b78ed 100644 (file)
--- a/pgen.c
+++ b/pgen.c
@@ -424,6 +424,7 @@ static int peset_x(PyObject *me, PyObject *xobj, void *hunoz)
   mp *x = 0;
   pgen_event *ev = PGEVENT_EV(me);
   int rc = -1;
+  if (!x) NIERR("__del__");
   PGEVENT_CHECK(me);
   if ((x = getmp(xobj)) == 0) goto end;
   mp_drop(ev->m);