A segfault waiting to happen, which has been lurking since the
beginning.
static PyObject *eccurve_pyrichcompare(PyObject *x, PyObject *y, int op)
{
static PyObject *eccurve_pyrichcompare(PyObject *x, PyObject *y, int op)
{
- int b = ec_samep(ECCURVE_C(x), ECCURVE_C(y));
+ int b;
+
+ assert(ECCURVE_PYCHECK(x));
+ if (!ECCURVE_PYCHECK(y)) RETURN_NOTIMPL;
+ b = ec_samep(ECCURVE_C(x), ECCURVE_C(y));
switch (op) {
case Py_EQ: break;
case Py_NE: b = !b; break;
switch (op) {
case Py_EQ: break;
case Py_NE: b = !b; break;