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.
This commit is contained in:
Martin v. Löwis 2006-07-24 11:54:53 +00:00
parent bda0dde1c4
commit d22968af17
2 changed files with 7 additions and 0 deletions

View File

@ -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.

View File

@ -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) {