changeset 10283:a6eb06987366

* lib/canonicalize-lgpl.c (__realpath): readlink can write too much into the buffer on platforms without PATH_MAX.
author Ulrich Drepper <drepper@redhat.com>
date Wed, 23 Jul 2008 10:24:43 +0200
parents e5edd1a3cc28
children d76cc695b4c6
files ChangeLog lib/canonicalize-lgpl.c
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jul 21 21:45:30 2008 -0600
+++ b/ChangeLog	Wed Jul 23 10:24:43 2008 +0200
@@ -1,3 +1,8 @@
+2008-07-23  Ulrich Drepper  <drepper@redhat.com>
+
+	* lib/canonicalize-lgpl.c (__realpath): readlink can write too
+	much into the buffer on platforms without PATH_MAX.
+
 2008-07-21  Eric Blake  <ebb9@byu.net>
 
 	Warn, not fail, on stale version.
--- a/lib/canonicalize-lgpl.c	Mon Jul 21 21:45:30 2008 -0600
+++ b/lib/canonicalize-lgpl.c	Wed Jul 23 10:24:43 2008 +0200
@@ -260,7 +260,7 @@
 		  goto error;
 		}
 
-	      n = __readlink (rpath, buf, path_max);
+	      n = __readlink (rpath, buf, path_max - 1);
 	      if (n < 0)
 		{
 		  int saved_errno = errno;