Repository navigation
gh-159398: Validate strings read from remote process in _remote_debugging - #159402
Conversation
Co-authored-by: vstinner@python.org
|
I reran the |
|
In Python 3.14, read_py_str() of Modules/_remote_debugging_module.c calls PyUnicode_FromStringAndSize(). I don't get how it works. It reads the UTF-8 representation of a string? What if the Unicode object has no UTF-8 representation? So it's unclear to me if Python 3.14 is also affected by the issue. |
vstinner
left a comment
There was a problem hiding this comment.
LGTM. Just some minor suggestions.
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-Authored-By: Maurycy Pawłowski-Wieroński <maurycy@maurycy.com>
|
@pablogsal is it alright to merge? |
|
FYI, I'm seeing CI failures for ASan build due to this bug. The error log is: |
|
Yes it's been annoying me too, I'll merge tomorrow if there are no more comments. |
|
Thanks @StanFromIreland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
GH-160963 is a backport of this pull request to the 3.15 branch. |
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>.