about summary refs log tree commit diff
path: root/elf/chroot_canon.c
diff options
context:
space:
mode:
authorThomas Jarosch <thomas.jarosch@intra2net.com>2011-10-29 12:24:38 -0400
committerUlrich Drepper <drepper@gmail.com>2011-10-29 12:24:38 -0400
commit1760874da6e4a6934751ea12cf2c06eae936b53c (patch)
treec38588e3cc48868e9e0660703d32ee45a8c0d113 /elf/chroot_canon.c
parent51d91b18954c998ccda310231f4d120f21a5fd79 (diff)
downloadglibc-1760874da6e4a6934751ea12cf2c06eae936b53c.tar.gz
glibc-1760874da6e4a6934751ea12cf2c06eae936b53c.tar.xz
glibc-1760874da6e4a6934751ea12cf2c06eae936b53c.zip
Fix readlink call in ldconfig's chroot handling
Diffstat (limited to 'elf/chroot_canon.c')
-rw-r--r--elf/chroot_canon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/elf/chroot_canon.c b/elf/chroot_canon.c
index 54a6a4cc96..b639cfa82d 100644
--- a/elf/chroot_canon.c
+++ b/elf/chroot_canon.c
@@ -1,5 +1,5 @@
 /* Return the canonical absolute name of a given file inside chroot.
-   Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005,2010
+   Copyright (C) 1996,1997,1998,1999,2000,2001,2004,2005,2010,2011
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -135,7 +135,7 @@ chroot_canon (const char *chroot, const char *name)
 		  goto error;
 		}
 
-	      n = readlink (rpath, buf, PATH_MAX);
+	      n = readlink (rpath, buf, PATH_MAX - 1);
 	      if (n < 0)
 		{
 		  if (*end == '\0')