You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/media-gfx/blender/files/blender-2.48a-CVE-2008-4863...

16 lines
696 B

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();