mirror of
https://github.com/python/cpython.git
synced 2026-06-27 13:20:40 -04:00
[3.15] gh-150633: Properly handle null characters in the name when importing frozen modules (GH-150634) (GH-151100)
(cherry picked from commit 54de5475cd)
Co-authored-by: Thomas Kowalski <thom.kowa@gmail.com>
This commit is contained in:
committed by
GitHub
parent
e795bd4be7
commit
5751633fac
+1
-1
@@ -3168,7 +3168,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
|
||||
|
||||
Reference in New Issue
Block a user