From: Victor Stinner Date: Fri, 15 Nov 2013 16:33:43 +0000 (+0100) Subject: sysmodule.c: fix sys_update_path(), use Py_ARRAY_LENGTH() to get the size of X-Git-Tag: v3.4.0b1~267^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2384714819751e975f3ee8c5b57ab1f702e25cac;p=thirdparty%2FPython%2Fcpython.git 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. --- diff --git a/Python/sysmodule.c b/Python/sysmodule.c index 1a41d2fa71ee..df9dfb1f0a0e 100644 --- a/Python/sysmodule.c +++ b/Python/sysmodule.c @@ -1895,7 +1895,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