GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Missing error handling in `_PyEval_GetFrameLocals` in `ceval.c` · Issue #118613 · python/cpython

Missing error handling in _PyEval_GetFrameLocals in ceval.c #118613

New issue
Copy link
New issue
Copy link
Closed
Closed
Missing error handling in _PyEval_GetFrameLocals in ceval.c#118613
Copy link
Assignees
sobolevn
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@sobolevn
sobolevn
opened on May 5, 2024
Issue body actions

Bug report

Here's the problematic code:

cpython/Python/ceval.c

Lines 2497 to 2504 in d8d9491

if (PyFrameLocalsProxy_Check(locals)) {
PyObject* ret = PyDict_New();
if (PyDict_Update(ret, locals)) {
Py_DECREF(ret);
return NULL;
}
Py_DECREF(locals);
return ret;

What's wrong?

  1. PyDict_New() can return NULL, it is not checked
  2. Py_DECREF(locals); is only called on success, but not on error

Refs b034f14

I have a PR ready.

Linked PRs

  • gh-118613: Fix error handling of _PyEval_GetFrameLocals in ceval.c #118614
Reacted by Kirill Podoprigora

Activity

  1. sobolevn
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
    on May 5, 2024
  2. sobolevn
    self-assigned this
    on May 5, 2024
  3. sobolevn
    added 2 commits that reference this issue on May 5, 2024

    pythongh-118613: Fix error handling of `_PyEval_GetFrameLocals` in `c…

    ab44c4a

    gh-118613: Fix error handling of `_PyEval_GetFrameLocals` in `ceval.c` (

    a8e5fed
  4. sobolevn
    closed this as completedon May 6, 2024
  5. SonicField
    added a commit that references this issue on May 8, 2024

    pythongh-118613: Fix error handling of `_PyEval_GetFrameLocals` in `c…

    86213f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @sobolevn
    sobolevn

Labels

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

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402503 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.