[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r1974 - in /fsf/trunk/libc: ChangeLog elf/ldconfig.c



Author: eglibc
Date: Sat Apr 14 00:01:20 2007
New Revision: 1974

Log:
Import glibc-mainline for 2007-04-14

Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/elf/ldconfig.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sat Apr 14 00:01:20 2007
@@ -1,3 +1,9 @@
+2007-04-13  Jakub Jelinek  <jakub@xxxxxxxxxx>
+
+	[BZ #4344]
+	* elf/ldconfig.c (search_dir): Fix 2 off-by-2 errors.
+	Reported by David Anderson <davea42@xxxxxxxxxxxxx>.
+
 2007-04-07  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* posix/sys/wait.h: Remove unnecessary forward declaration.

Modified: fsf/trunk/libc/elf/ldconfig.c
==============================================================================
--- fsf/trunk/libc/elf/ldconfig.c (original)
+++ fsf/trunk/libc/elf/ldconfig.c Sat Apr 14 00:01:20 2007
@@ -707,10 +707,10 @@
 			 + 1, ".#prelink#.", sizeof (".#prelink#.") - 1) == 0)
 	    continue;
 	}
-      len += strlen (entry->path);
+      len += strlen (entry->path) + 2;
       if (len > file_name_len)
 	{
-	  file_name_len = len + 1;
+	  file_name_len = len;
 	  file_name = alloca (file_name_len);
 	  if (!opt_chroot)
 	    real_file_name = file_name;
@@ -718,10 +718,10 @@
       sprintf (file_name, "%s/%s", entry->path, direntry->d_name);
       if (opt_chroot)
 	{
-	  len = strlen (dir_name) + strlen (direntry->d_name);
+	  len = strlen (dir_name) + strlen (direntry->d_name) + 2;
 	  if (len > real_file_name_len)
 	    {
-	      real_file_name_len = len + 1;
+	      real_file_name_len = len;
 	      real_file_name = alloca (real_file_name_len);
 	    }
 	  sprintf (real_file_name, "%s/%s", dir_name, direntry->d_name);