changeset 51309 | 13e2e64337be |
parent 51102 | 90144bc10fe6 |
child 51597 | 4c78f4fd8370 |
--- a/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c Fri Aug 03 09:42:57 2018 -0700 +++ b/src/java.base/unix/native/libnio/fs/UnixNativeDispatcher.c Fri Aug 03 12:45:18 2018 -0700 @@ -875,7 +875,10 @@ } else { jsize len; if (n == sizeof(target)) { - n--; + /* Traditionally readlink(2) should not return more than */ + /* PATH_MAX bytes (no terminating null byte is appended). */ + throwUnixException(env, ENAMETOOLONG); + return NULL; } target[n] = '\0'; len = (jsize)strlen(target);