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

[commits] r12920 - in /fsf/trunk/libc: ChangeLog NEWS elf/rtld.c stdio-common/Makefile stdio-common/bug23.c stdio-common/vfprintf.c



Author: eglibc
Date: Mon Feb 21 00:03:28 2011
New Revision: 12920

Log:
Import glibc-mainline for 2011-02-21

Added:
    fsf/trunk/libc/stdio-common/bug23.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/elf/rtld.c
    fsf/trunk/libc/stdio-common/Makefile
    fsf/trunk/libc/stdio-common/vfprintf.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Mon Feb 21 00:03:28 2011
@@ -1,3 +1,20 @@
+2011-01-27  Petr Baudis  <pasky@xxxxxxx>
+	    Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	[BZ 12445]#
+	* stdio-common/vfprintf.c (vfprintf): Pass correct newlen
+	to extend_alloca().
+	* stdio-common/bug23.c: New file.
+	* stdio-common/Makefile (tests): Add bug23.
+
+2010-09-28  Andreas Schwab  <schwab@xxxxxxxxxx>
+	    Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	[BZ #12489]
+	* elf/rtld.c (dl_main): Move setting of GLRO(dl_init_all_dirs)
+	before performing relro protection.  At old place add assertion
+	to make sure nothing changed.
+
 2011-02-17  Nathan Sidwell  <nathan@xxxxxxxxxxxxxxxx>
 	    Glauber de Oliveira Costa  <glommer@xxxxxxxxx>
 

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Mon Feb 21 00:03:28 2011
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2011-2-17
+GNU C Library NEWS -- history of user-visible changes.  2011-2-20
 Copyright (C) 1992-2009, 2010, 2011 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -9,7 +9,7 @@
 
 * The following bugs are resolved with this release:
 
-  11724, 12460, 12469
+  11724, 12445, 12460, 12469, 12489
 
 Version 2.13
 

Modified: fsf/trunk/libc/elf/rtld.c
==============================================================================
--- fsf/trunk/libc/elf/rtld.c (original)
+++ fsf/trunk/libc/elf/rtld.c Mon Feb 21 00:03:28 2011
@@ -1,5 +1,5 @@
 /* Run time dynamic linker.
-   Copyright (C) 1995-2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1995-2010, 2011 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
@@ -2179,6 +2179,10 @@
      we need it in the memory handling later.  */
   GLRO(dl_initial_searchlist) = *GL(dl_ns)[LM_ID_BASE]._ns_main_searchlist;
 
+  /* Remember the last search directory added at startup, now that
+     malloc will no longer be the one from dl-minimal.c.  */
+  GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
+
   if (prelinked)
     {
       if (main_map->l_info [ADDRIDX (DT_GNU_CONFLICT)] != NULL)
@@ -2298,9 +2302,8 @@
 			  lossage);
     }
 
-  /* Remember the last search directory added at startup, now that
-     malloc will no longer be the one from dl-minimal.c.  */
-  GLRO(dl_init_all_dirs) = GL(dl_all_dirs);
+  /* Make sure no new search directories have been added.  */
+  assert (GLRO(dl_init_all_dirs) == GL(dl_all_dirs));
 
   if (! prelinked && rtld_multiple_ref)
     {

Modified: fsf/trunk/libc/stdio-common/Makefile
==============================================================================
--- fsf/trunk/libc/stdio-common/Makefile (original)
+++ fsf/trunk/libc/stdio-common/Makefile Mon Feb 21 00:03:28 2011
@@ -60,7 +60,7 @@
 	 tst-popen tst-unlockedio tst-fmemopen2 tst-put-error tst-fgets \
 	 tst-fwrite bug16 bug17 tst-swscanf tst-sprintf2 bug18 bug18a \
 	 bug19 bug19a tst-popen2 scanf13 scanf14 scanf15 bug20 bug21 bug22 \
-	 scanf16 scanf17 tst-setvbuf1 tst-grouping
+	 scanf16 scanf17 tst-setvbuf1 tst-grouping bug23
 
 test-srcs = tst-unbputc tst-printf
 

Added: fsf/trunk/libc/stdio-common/bug23.c
==============================================================================
--- fsf/trunk/libc/stdio-common/bug23.c (added)
+++ fsf/trunk/libc/stdio-common/bug23.c Mon Feb 21 00:03:28 2011
@@ -1,0 +1,21 @@
+#include <stdio.h>
+#include <string.h>
+
+static char buf[32768];
+static const char expected[] = "\
+\n\
+a\n\
+abbcd55%%%%%%%%%%%%%%%%%%%%%%%%%%\n";
+
+static int
+do_test (void)
+{
+  snprintf (buf, sizeof (buf),
+	    "\n%1$s\n" "%1$s" "%2$s" "%2$s" "%3$s" "%4$s" "%5$d" "%5$d"
+	    "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\n",
+	    "a", "b", "c", "d", 5);
+  return strcmp (buf, expected) != 0;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/stdio-common/vfprintf.c
==============================================================================
--- fsf/trunk/libc/stdio-common/vfprintf.c (original)
+++ fsf/trunk/libc/stdio-common/vfprintf.c Mon Feb 21 00:03:28 2011
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2008, 2009, 2010   Free Software Foundation, Inc.
+/* Copyright (C) 1991-2008, 2009, 2010, 2011   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
@@ -1682,7 +1682,8 @@
 	  {
 	    /* Extend the array of format specifiers.  */
 	    struct printf_spec *old = specs;
-	    specs = extend_alloca (specs, nspecs_max, 2 * nspecs_max);
+	    specs = extend_alloca (specs, nspecs_max,
+				   2 * nspecs_max * sizeof (*specs));
 
 	    /* Copy the old array's elements to the new space.  */
 	    memmove (specs, old, nspecs * sizeof (struct printf_spec));