From 111c20b992e523dd094d9b3c459aa21eb2778cea Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Sat, 11 Apr 1998 17:38:22 +0000 Subject: Reject empty module names -- otherwise __import__("") does something weird! --- Python/import.c | 5 +++++ 1 file changed, 5 insertions(+) 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) -- cgit v0.12