Fix unlikely overflows with wd length
commit934f08f3de7929e54e9da3271a34bb49a8854f2c
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 9 Oct 2017 17:30:40 +0000 (9 10:30 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 9 Oct 2017 17:48:55 +0000 (9 10:48 -0700)
tree99f898f4f6242d35d697749957ca41e813054ca7
parent6c2b1e89efe90e1b55bc0f0296e68efa52dbcbc1
Fix unlikely overflows with wd length

* src/sysdep.c (get_current_dir_name_or_unreachable):
Avoid integer overflow if working directory name is absurdly long.
When allocating memory for getcwd, do not exceed MAXPATHLEN.
src/sysdep.c