Skip to content

PyObject_Length not considered setting exception #162

Open
@dvarrazzo

Description

@dvarrazzo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions