gcc-python-plugin icon indicating copy to clipboard operation
gcc-python-plugin copied to clipboard

PyObject_Length not considered setting exception

Open dvarrazzo opened this issue 7 years ago • 0 comments

The following function:

static PyObject *
psyco_curs_callproc(cursorObject *self, PyObject *args)
{
    PyObject *parameters = NULL;
    Py_ssize_t nparameters = 0;

    if (!PyArg_ParseTuple(args, "O", &parameters)) {
        goto exit;
    }

    nparameters = PyObject_Length(parameters);
    if (nparameters == -1) { return NULL; }

    Py_RETURN_NONE;
}

returns a false positive, stating that if PyObject_Length fails the function returns without an exception.

image

dvarrazzo avatar Jan 02 '19 11:01 dvarrazzo