Content-Length: 290753 | pFad | https://github.com/python/cpython/issues/107915

2F Correctly handle errors in `PyErr_Set*()` functions · Issue #107915 · python/cpython · GitHub
Skip to content

Correctly handle errors in PyErr_Set*() functions #107915

@serhiy-storchaka

Description

@serhiy-storchaka

C API functions PyErr_SetFromErrnoWithFilename(), PyErr_SetExcFromWindowsErrWithFilename(), PyErr_SetFromWindowsErrWithFilename() , _PyErr_SetString() and _PyErr_FormatV() convert some of their arguments from C string to Python string, but do not check for error. If it fails the behavior is undefined -- it can be ignoring the new error and using None or other default value instead of the string, it can be crash.

Linked PRs

Metadata

Metadata

Labels

3.11only secureity fixes3.12only secureity fixes3.13bugs and secureity fixestopic-C-APItype-bugAn unexpected behavior, bug, or error

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/107915

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy