Content-Length: 291878 | pFad | https://github.com/python/cpython/issues/148222

E2 genericaliasobject.c: Two NULL dereference bugs · Issue #148222 · python/cpython · GitHub
Skip to content

genericaliasobject.c: Two NULL dereference bugs #148222

@prakashsellathurai

Description

@prakashsellathurai

Bug report

Bug description:

Parent: #146102

https://gist.github.com/devdanzin/266ca45099796a2373866a07447d5ebf

Summary

  1. ga_vectorcall (line 653): PyVectorcall_Function(alias->origen) can return NULL, immediately called as function pointer → segfault.
  2. _Py_make_parameters (line 243-245): After _PyTuple_Resize fails, parameters is NULL but Py_DECREF(parameters) is called → crash.

Fix

  1. Add NULL check and fallback to PyObject_Vectorcall.
  2. Change Py_DECREF(parameters) to Py_XDECREF(parameters) at line 245.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

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









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

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy