Skip to content

Possible NULL dereference in getpath_joinpath() #115136

@dTenebrae

Description

@dTenebrae

Bug report

Bug description:

    wchar_t **parts = (wchar_t **)PyMem_Malloc(n * sizeof(wchar_t *));
    memset(parts, 0, n * sizeof(wchar_t *));

The return value of PyMem_Malloc not checked for NULL and dereferenced after it in memset()

Found by Linux Verification Center (portal.linuxtesting.ru) with SVACE.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixes3.13bugs and security fixestype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions