Kaydet (Commit) 50e01570 authored tarafından Victor Stinner's avatar Victor Stinner

(Merge 3.3) sysmodule.c: fix sys_update_path(), use Py_ARRAY_LENGTH() to get

the size of the fullpath buffer, not PATH_MAX. fullpath is declared using
MAXPATHLEN or MAX_PATH depending on the OS, and PATH_MAX is not declared on
IRIX.
......@@ -1959,7 +1959,7 @@ sys_update_path(int argc, wchar_t **argv)
#else /* All other filename syntaxes */
if (_HAVE_SCRIPT_ARGUMENT(argc, argv)) {
#if defined(HAVE_REALPATH)
if (_Py_wrealpath(argv0, fullpath, PATH_MAX)) {
if (_Py_wrealpath(argv0, fullpath, Py_ARRAY_LENGTH(fullpath))) {
argv0 = fullpath;
}
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment