diff options
| author | Guido van Rossum <guido@python.org> | 1998-04-11 17:38:22 (GMT) |
|---|---|---|
| committer | Guido van Rossum <guido@python.org> | 1998-04-11 17:38:22 (GMT) |
| commit | 111c20b992e523dd094d9b3c459aa21eb2778cea (patch) | |
| tree | 8189f8d06796502793f6edec8b231e0aeb7bb1cc /Python/import.c | |
| parent | 70c460c84d3b025f005e158ec83d6b083368025a (diff) | |
| download | cpython-111c20b992e523dd094d9b3c459aa21eb2778cea.zip cpython-111c20b992e523dd094d9b3c459aa21eb2778cea.tar.gz cpython-111c20b992e523dd094d9b3c459aa21eb2778cea.tar.bz2 | |
Reject empty module names -- otherwise __import__("") does something
weird!
Diffstat (limited to 'Python/import.c')
| -rw-r--r-- | Python/import.c | 5 |
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) |
