mirror of
https://github.com/python/cpython.git
synced 2026-06-10 20:01:28 +00:00
gh-150633: Properly handle null characters in the name when importing frozen modules (GH-150634)
This commit is contained in:
parent
5c13217314
commit
54de5475cd
3 changed files with 13 additions and 1 deletions
|
|
@ -3174,7 +3174,7 @@ find_frozen(PyObject *nameobj, struct frozen_info *info)
|
|||
if (nameobj == NULL || nameobj == Py_None) {
|
||||
return FROZEN_BAD_NAME;
|
||||
}
|
||||
const char *name = PyUnicode_AsUTF8(nameobj);
|
||||
const char *name = _PyUnicode_AsUTF8NoNUL(nameobj);
|
||||
if (name == NULL) {
|
||||
// Note that this function previously used
|
||||
// _PyUnicode_EqualToASCIIString(). We clear the error here
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue