1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00
2008-06-25  Ulrich Drepper  <drepper@redhat.com>
	[BZ #6654]
	* stdlib/canonicalize.c (__realpath): readlink can write too much
	into the buffer on platforms without PATH_MAX.
This commit is contained in:
Ulrich Drepper
2008-06-26 00:42:12 +00:00
parent 4cb8e687af
commit 104426b654
4 changed files with 34 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/* Return the canonical absolute name of a given file.
Copyright (C) 1996-2002, 2004, 2005, 2006 Free Software Foundation, Inc.
Copyright (C) 1996-2002,2004,2005,2006,2008 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -173,7 +173,7 @@ __realpath (const char *name, char *resolved)
goto error;
}
n = __readlink (rpath, buf, path_max);
n = __readlink (rpath, buf, path_max - 1);
if (n < 0)
goto error;
buf[n] = '\0';