* path.cc (readlink): 'max' should be a 'min' or we'll suffer buffer overflow.
This commit is contained in:
parent
a36cd013b9
commit
e321565bbc
@ -1,3 +1,8 @@
|
||||
Tue Sep 5 17:49:34 2000 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* path.cc (readlink): 'max' should be a 'min' or we'll suffer
|
||||
buffer overflow.
|
||||
|
||||
Mon Sep 4 22:53:58 2000 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* path.cc (cwd_win32): Eliminate.
|
||||
|
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user