Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PyObject_Length not considered setting exception #162

Open
dvarrazzo opened this issue Jan 2, 2019 · 0 comments
Open

PyObject_Length not considered setting exception #162

dvarrazzo opened this issue Jan 2, 2019 · 0 comments

Comments

@dvarrazzo
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant