Blob Blame History Raw
diff -up blender-2.48a/source/blender/python/BPY_interface.c.cve blender-2.48a/source/blender/python/BPY_interface.c
--- blender-2.48a/source/blender/python/BPY_interface.c.cve	2008-11-03 17:31:19.000000000 +0100
+++ blender-2.48a/source/blender/python/BPY_interface.c	2008-11-03 17:35:01.000000000 +0100
@@ -225,6 +225,11 @@ void BPY_start_python( int argc, char **
 	Py_Initialize(  );
 	
 	PySys_SetArgv( argc_copy, argv_copy );
+	
+	/* Sanitize sys.path to prevent relative imports loading modules in
+	   the current working directory */
+	PyRun_SimpleString("import sys; sys.path = filter(None, sys.path)");
+
 	/* Initialize thread support (also acquires lock) */
 	PyEval_InitThreads();