summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-07-24 11:54:53 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-07-24 11:54:53 (GMT)
commitd22968af17f64ed5883f9cccfed0f0337dc3bc19 (patch)
tree110d2d41c31915a7a1b1237c87e1ee05cc661c4a
parentbda0dde1c46c7f86c09f1b54d0b14125e9ab7f52 (diff)
downloadcpython-d22968af17f64ed5883f9cccfed0f0337dc3bc19.zip
cpython-d22968af17f64ed5883f9cccfed0f0337dc3bc19.tar.gz
cpython-d22968af17f64ed5883f9cccfed0f0337dc3bc19.tar.bz2
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.
-rw-r--r--Misc/NEWS3
-rw-r--r--PC/getpathp.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 7a6e22d..eee36c6 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 2bd3f26..729d2e4 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) {