summaryrefslogtreecommitdiff
path: root/ext/Cwd
diff options
context:
space:
mode:
authorCasey West <casey@geeknest.com>2003-11-03 05:11:43 -0500
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-11-03 20:00:07 +0000
commit7f6e23a86c35581b9f224abd034c75f59268efcf (patch)
tree0bc01c2dbf1ca3636d7aed07a0d94adc76bcc06f /ext/Cwd
parentb3b3b51f2aca280525d4cb829ec224645bf84b5a (diff)
downloadperl-7f6e23a86c35581b9f224abd034c75f59268efcf.tar.gz
Cwd.xs: off-by-one buffer overflow in realpath()
Message-ID: <20031103151143.GB430@geeknest.com> p4raw-id: //depot/perl@21646
Diffstat (limited to 'ext/Cwd')
-rw-r--r--ext/Cwd/Cwd.xs2
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;
}