]> granicus.if.org Git - python/commitdiff
sysmodule.c: fix sys_update_path(), use Py_ARRAY_LENGTH() to get the size of
authorVictor Stinner <victor.stinner@gmail.com>
Fri, 15 Nov 2013 16:33:43 +0000 (17:33 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Fri, 15 Nov 2013 16:33:43 +0000 (17:33 +0100)
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.

Python/sysmodule.c

index 1a41d2fa71ee78c384bbdd8afd26514f9b793f54..df9dfb1f0a0ed5412c29593f2975094c8a5c552d 100644 (file)
@@ -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