[New-bugs-announce] [issue29778] _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath

Tibor Csonka report at bugs.python.org
Thu Mar 9 23:58:18 EST 2017


New submission from Tibor Csonka:

When Py_SetPath is used to set up module path at initialization, the Py_SetPath causes getpathp.c::calculate_path not to be called. However, calculate path is the only function calling getpathp.c::get_progpath which initializes the local dllpath static variable.

Later the interpreter tries to load python3.dll and uses dllpath which is empty by default. This empty path gets joined with \python3.dll and \DLLs\python3.dll which is used in the LoadLibraryExW resulting in loading python3.dll from the root location of the windows drive the application is running from.

The behavior was reproduced using PyInstaller but it is present in any embedding application which uses Py_SetPath.

----------
components: Windows
messages: 289334
nosy: Tibor Csonka, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: _Py_CheckPython3 uses uninitialized dllpath when embedder sets module path with Py_SetPath
versions: Python 3.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29778>
_______________________________________


More information about the New-bugs-announce mailing list