Skip to content

potential nullptr dereference + use of uninitialized memory in fileutils #102281

Description

@maxbachmann

Bug report

cpython/Python/fileutils.c

Lines 2161 to 2162 in 6daf42b

join_relfile(filename, bufsize, dirname, relfile);
return filename;
can lead to use of uninitialized memory when join_relfile fails.

cpython/Python/fileutils.c

Lines 2197 to 2199 in 6daf42b

_Py_normpath(wchar_t *path, Py_ssize_t size)
{
if (!path[0] || size == 0) {
in combination with
path2 = _Py_normpath(_Py_join_relfile(path, resolved), -1);

leads to a nullptr dereference.

Linked PRs

Activity

  1. added a commit that references this issue on Mar 15, 2023
  2. hauntsaninja commented on Mar 25, 2023

    @hauntsaninja
    Contributor

    Thanks for the fix! Looks like this could still use backports

  3. maxbachmann commented on Mar 25, 2023

    @maxbachmann
    ContributorAuthor

    Thanks for the reminder

  4. added a commit that references this issue on Mar 25, 2023
  5. hauntsaninja commented on Mar 25, 2023

    @hauntsaninja
    Contributor

    Thanks again :-)

  6. added a commit that references this issue on Mar 27, 2023
  7. added a commit that references this issue on Apr 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions