Kaydet (Commit) 111c20b9 authored tarafından Guido van Rossum's avatar Guido van Rossum

Reject empty module names -- otherwise __import__("") does something

weird!
üst 70c460c8
...@@ -1515,6 +1515,11 @@ load_next(mod, altmod, p_name, buf, p_buflen) ...@@ -1515,6 +1515,11 @@ load_next(mod, altmod, p_name, buf, p_buflen)
*p_name = dot+1; *p_name = dot+1;
len = dot-name; len = dot-name;
} }
if (len == 0) {
PyErr_SetString(PyExc_ValueError,
"Empty module name");
return NULL;
}
p = buf + *p_buflen; p = buf + *p_buflen;
if (p != buf) if (p != buf)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment