From 7740d7fabd89255eeef087b727d7360a2a9a68a5 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sat, 19 Oct 2019 18:19:07 +0100 Subject: [PATCH] key.c, pgen.c: Add missing guards for `del' to property `set' functions. --- key.c | 2 ++ pgen.c | 1 + 2 files changed, 3 insertions(+) diff --git a/key.c b/key.c index 8dec99c..cb0ac72 100644 --- 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 --- 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); -- 2.11.0