Skip to content

legacy_tracing.c: Unchecked PyLong_AsInt in tracing callbacks #153622

Description

@aisk

Bug report

Bug description:

Original gist: https://gist.github.com/devdanzin/d1a6ab9f62970be0cae139366ce3c482

Summary

sys_trace_jump_func (line 382-384) and sys_trace_line_func (line 355): PyLong_AsInt error return -1 not checked. Proceeds with wrong values and pending exception.

Fix

Add if (result == -1 && PyErr_Occurred()) return NULL; checks.

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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions