Skip to content

Commit 50e0157

Browse files
committed
(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.
2 parents b5a7a0a + 2384714 commit 50e0157

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1959,7 +1959,7 @@ sys_update_path(int argc, wchar_t **argv)
19591959
#else /* All other filename syntaxes */
19601960
if (_HAVE_SCRIPT_ARGUMENT(argc, argv)) {
19611961
#if defined(HAVE_REALPATH)
1962-
if (_Py_wrealpath(argv0, fullpath, PATH_MAX)) {
1962+
if (_Py_wrealpath(argv0, fullpath, Py_ARRAY_LENGTH(fullpath))) {
19631963
argv0 = fullpath;
19641964
}
19651965
#endif

0 commit comments

Comments
 (0)