summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-04-11 17:38:22 (GMT)
committerGuido van Rossum <guido@python.org>1998-04-11 17:38:22 (GMT)
commit111c20b992e523dd094d9b3c459aa21eb2778cea (patch)
tree8189f8d06796502793f6edec8b231e0aeb7bb1cc
parent70c460c84d3b025f005e158ec83d6b083368025a (diff)
downloadcpython-111c20b992e523dd094d9b3c459aa21eb2778cea.zip
cpython-111c20b992e523dd094d9b3c459aa21eb2778cea.tar.gz
cpython-111c20b992e523dd094d9b3c459aa21eb2778cea.tar.bz2
Reject empty module names -- otherwise __import__("") does something
weird!
-rw-r--r--Python/import.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Python/import.c b/Python/import.c
index 6eb794f2..afbd4d8 100644
--- a/Python/import.c
+++ b/Python/import.c
@@ -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)