diff options
-rw-r--r-- | ext/Cwd/Cwd.xs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/Cwd/Cwd.xs b/ext/Cwd/Cwd.xs index 3f7b93b231..4600fefb11 100644 --- a/ext/Cwd/Cwd.xs +++ b/ext/Cwd/Cwd.xs @@ -166,7 +166,7 @@ loop: rootd = 0; if (*wbuf) { - if (strlen(resolved) + strlen(wbuf) + rootd + 1 > MAXPATHLEN) { + if (strlen(resolved) + strlen(wbuf) + (1 - rootd) + 1 > MAXPATHLEN) { errno = ENAMETOOLONG; goto err1; } |