summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-09-05 21:51:06 +0000
committerChristopher Faylor <me@cgf.cx>2000-09-05 21:51:06 +0000
commite321565bbcb9b969975f985160da076cc586ed94 (patch)
tree73ee3a57207235499b165fc10c5cb5471bdad00e /winsup/cygwin/path.cc
parenta36cd013b90e700c00775b79445aeb6748fd3123 (diff)
downloadcygnal-e321565bbcb9b969975f985160da076cc586ed94.tar.gz
cygnal-e321565bbcb9b969975f985160da076cc586ed94.tar.bz2
cygnal-e321565bbcb9b969975f985160da076cc586ed94.zip
* path.cc (readlink): 'max' should be a 'min' or we'll suffer buffer overflow.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 599d00a79..2033d257c 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2353,7 +2353,7 @@ readlink (const char *path, char *buf, int buflen)
return -1;
}
- int len = max (buflen, (int) strlen (pathbuf.get_win32 ()));
+ int len = min (buflen, (int) strlen (pathbuf.get_win32 ()));
memcpy (buf, pathbuf.get_win32 (), len);
/* errno set by symlink.check if error */