From d26c1ca84b76aa4c85b33ffbb0ee0a82cb75c092 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Sun, 20 Oct 2019 01:19:18 +0100 Subject: [PATCH] algorithms.c: Add missing guard for `del' to property `set' functions. Continuing the work of 9444777c58c60253afdabf5b45011440845770e0. --- algorithms.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/algorithms.c b/algorithms.c index 0f05f75..3d79c03 100644 --- a/algorithms.c +++ b/algorithms.c @@ -1675,10 +1675,14 @@ static int kxvikset_nround(PyObject *me, PyObject *val, void *hunoz) { kxvik_pyobj *k = (kxvik_pyobj *)me; unsigned n; + int rc = -1; - if (!convuint(val, &n)) return (-1); + if (!val) NIERR("__del__"); + if (!convuint(val, &n)) goto end; k->n = n; - return (0); + rc = 0; +end: + return (rc); } static PyGetSetDef kxvik_pygetset[] = { -- 2.11.0