mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
Reject empty module names -- otherwise __import__("") does something
weird!
This commit is contained in:
parent
70c460c84d
commit
111c20b992
1 changed files with 5 additions and 0 deletions
|
@ -1515,6 +1515,11 @@ load_next(mod, altmod, p_name, buf, p_buflen)
|
|||
*p_name = dot+1;
|
||||
len = dot-name;
|
||||
}
|
||||
if (len == 0) {
|
||||
PyErr_SetString(PyExc_ValueError,
|
||||
"Empty module name");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p = buf + *p_buflen;
|
||||
if (p != buf)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue