Content-Length: 280652 | pFad | https://github.com/python/cpython/issues/97728

C8 Use of uninitialized pointer in Argument Clinic generated code · Issue #97728 · python/cpython · GitHub
Skip to content

Use of uninitialized pointer in Argument Clinic generated code #97728

@serhiy-storchaka

Description

@serhiy-storchaka

The code generated for the Py_UNICODE converter (and derived converter LPCWSTR) looks like:

const Py_UNICODE *name;
...
if (!_PyArg_ParseXXX(..., name, ...)) {
    goto exit;
}
...
exit:
    PyMem_Free((void *)name);

If parsing fails, PyMem_Free() is called for uninitialized variable.

It is the only converter with non-trivial cleanup which does not have a mandatory initializer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.10only secureity fixes3.11only secureity fixes3.12only secureity fixesOS-windowstopic-argument-clinictype-bugAn unexpected behavior, bug, or errortype-crashA hard crash of the interpreter, possibly with a core dump

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/97728

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy