summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorJan Dubois <jand@activestate.com>2004-03-07 09:04:35 -0800
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-03-08 08:06:33 +0000
commit0b96339f066406ec3091aa3edc23d79475da8df5 (patch)
treeaf6537187cd6e5cbe336e4b30afe05a9d2e16328 /win32
parent4c94c214622791382d764e5aa3e12c672818b5fb (diff)
downloadperl-0b96339f066406ec3091aa3edc23d79475da8df5.tar.gz
win32_fstat has a potential buffer overrun problem
Message-ID: <8lgn409p4k2kpde8d428d7a4r7fsgjc8b4@4ax.com> p4raw-id: //depot/perl@22466
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 19662af800..b36a7b7e46 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1182,6 +1182,10 @@ win32_stat(const char *path, Stat_t *sbuf)
/* FindFirstFile() and stat() are buggy with a trailing
* backslash, so change it to a forward slash :-( */
case '\\':
+ if (l >= sizeof(buffer)) {
+ errno = ENAMETOOLONG;
+ return -1;
+ }
strncpy(buffer, path, l-1);
buffer[l - 1] = '/';
buffer[l] = '\0';