From: Guido van Rossum Date: Sat, 11 Apr 1998 17:38:22 +0000 (+0000) Subject: Reject empty module names -- otherwise __import__("") does something X-Git-Tag: v1.5.1~42 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=111c20b992e523dd094d9b3c459aa21eb2778cea;p=python Reject empty module names -- otherwise __import__("") does something weird! --- diff --git a/Python/import.c b/Python/import.c index 6eb794f298..afbd4d8ba3 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)