Skip to content

Commit

Permalink
sysmodule.c: fix sys_update_path(), use Py_ARRAY_LENGTH() to get the …
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
vstinner committed Nov 15, 2013
1 parent 2f5bbc6 commit 2384714
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Python/sysmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2384714

Please sign in to comment.