From: Guido van Rossum Date: Thu, 7 May 1998 16:29:10 +0000 (+0000) Subject: Add check to conjugate() that there are no excess arguments. X-Git-Tag: v1.5.2a1~712 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8530ef625aabda9d11ffcee8c4c6fd7230c05185;p=python Add check to conjugate() that there are no excess arguments. --- diff --git a/Objects/complexobject.c b/Objects/complexobject.c index a186c8ec58..2e97713156 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -573,17 +573,20 @@ complex_float(v) } static PyObject * -complex_conjugate(self) +complex_conjugate(self, args) PyObject *self; + PyObject *args; { Py_complex c; + if (!PyArg_ParseTuple(args, "")) + return NULL; c = ((PyComplexObject *)self)->cval; c.imag = -c.imag; return PyComplex_FromCComplex(c); } static PyMethodDef complex_methods[] = { - {"conjugate", (PyCFunction)complex_conjugate, 1}, + {"conjugate", complex_conjugate, 1}, {NULL, NULL} /* sentinel */ };