Skip to content

Commit 6db8202

Browse files
bstaleticdrmoose
authored andcommitted
Always use the CVE-2008-5983 fallback rather than #ifdef'ing around it.
1 parent 0566160 commit 6db8202

File tree

1 file changed

+0
-8
lines changed

1 file changed

+0
-8
lines changed

include/pybind11/embed.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,17 +153,9 @@ inline void set_interpreter_argv(int argc, char** argv, bool add_current_dir_to_
153153
auto pysys_argv = safe_argv;
154154
#endif
155155

156-
#if PY_MAJOR_VERSION == 2 && (PY_MINOR_VERSION < 6 || (PY_MINOR_VERSION == 6 && PY_MICRO_VERSION < 6)) || \
157-
PY_MAJOR_VERSION == 3 && (PY_MINOR_VERSION < 1 || (PY_MINOR_VERSION == 1 && PY_MICRO_VERSION < 3))
158-
// These python versions don't have PySys_SetArgvEx, so we have to use the workaround
159-
// recommended by https://docs.python.org/3.5/c-api/init.html#c.PySys_SetArgvEx
160-
// to work around CVE-2008-5983
161156
PySys_SetArgv(argc, pysys_argv);
162157
if (!add_current_dir_to_path)
163158
PyList_PopItem(py::module::import("sys").attr("path").ptr(), 0);
164-
#else
165-
PySys_SetArgvEx(argc, pysys_argv, add_current_dir_to_path ? 1 : 0);
166-
#endif
167159
}
168160

169161
PYBIND11_NAMESPACE_END(detail)

0 commit comments

Comments
 (0)