Skip to content

Commit 2ea6d25

Browse files
cjihrigtargos
authored andcommitted
deps: libuv: cherry-pick 0e6e8620
Original commit message: unix: don't use _POSIX_PATH_MAX Libuv was using _POSIX_PATH_MAX wrong. Bug introduced in commit b56d279b ("unix: do not require PATH_MAX to be defined") from September 2018. _POSIX_PATH_MAX is the minimum max path size guaranteed by POSIX, not the actual max path size of the system libuv runs on. _POSIX_PATH_MAX is always 256, the real max is often much bigger. This commit fixes buffer overruns when processing very long paths in uv_fs_readlink() and uv_fs_realpath() because libuv was not allocating enough memory to store the result. Fixes: libuv/libuv#2965 PR-URL: libuv/libuv#2966 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Jameson Nash <vtjnash@gmail.com> CVE-ID: CVE-2020-8252 PR-URL: nodejs-private/node-private#221 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com> Reviewed-By: Michael Dawson <midawson@redhat.com>
1 parent edad52e commit 2ea6d25

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

deps/uv/src/unix/internal.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@
6262
# include <AvailabilityMacros.h>
6363
#endif
6464

65-
#if defined(_POSIX_PATH_MAX)
66-
# define UV__PATH_MAX _POSIX_PATH_MAX
67-
#elif defined(PATH_MAX)
65+
#if defined(PATH_MAX)
6866
# define UV__PATH_MAX PATH_MAX
6967
#else
7068
# define UV__PATH_MAX 8192

0 commit comments

Comments
 (0)