From: Martin v. Löwis Date: Mon, 24 Jul 2006 11:54:53 +0000 (+0000) Subject: Patch #1232023: Don't include empty path component from registry, X-Git-Tag: v2.5b3~183 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d22968af17f64ed5883f9cccfed0f0337dc3bc19;p=thirdparty%2FPython%2Fcpython.git Patch #1232023: Don't include empty path component from registry, so that the current directory does not get added to sys.path. Also fixes #1526785. --- diff --git a/Misc/NEWS b/Misc/NEWS index 7a6e22d563d9..eee36c606d80 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -12,6 +12,9 @@ What's New in Python 2.5 release candidate 1? Core and builtins ----------------- +- Patch #1232023: Stop including current directory in search + path on Windows. + - Fix some potential crashes found with failmalloc. - Fix warnings reported by Klocwork's static analysis tool. diff --git a/PC/getpathp.c b/PC/getpathp.c index 2bd3f2653fda..729d2e4736bb 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -297,6 +297,10 @@ getpythonregpath(HKEY keyBase, int skipcore) } RegCloseKey(subKey); } + + /* return null if no path to return */ + if (dataSize == 0) goto done; + /* original datasize from RegQueryInfo doesn't include the \0 */ dataBuf = malloc((dataSize+1) * sizeof(TCHAR)); if (dataBuf) {