Skip to content

gh-159398: Validate strings read from remote process in _remote_debugging - #159402

Open
StanFromIreland wants to merge 2 commits into
python:mainfrom
StanFromIreland:gh-159398
Open

StanFromIreland wants to merge 2 commits into
python:mainfrom
StanFromIreland:gh-159398

Conversation

@StanFromIreland

@StanFromIreland StanFromIreland commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

Instead of copying the remote bytes straight into a str, we now read them into a temp buffer and build the result with PyUnicode_FromKindAndData, which validates the characters and picks the narrowest kind. Bad names raise an error so we end up with <unknown function>.

Comment thread Modules/_remote_debugging/object_reading.c
Comment thread Modules/_testinternalcapi.c Outdated
Co-authored-by: vstinner@python.org
@maurycy

maurycy commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

I reran the Tools/inspection/oracle_external_inspection.py on macOS, no change.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants