]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Thu, 17 Jun 1999 09:36:54 +0000 (09:36 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 17 Jun 1999 09:36:54 +0000 (09:36 +0000)
1999-06-17  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

* elf/dl-load.c (_dl_init_paths): Add one more element to aelem
to not write beyond allocated memory.
Reported by John Reiser <jreiser@BitWagon.com>, closes PR libc/1167.

1999-06-17  Ulrich Drepper  <drepper@cygnus.com>

* malloc/mtrace.c: Keep lock while printing output lines.
Patch by carsten.zimmermann@mediaways.net [PR libc/1166].

ChangeLog
elf/dl-load.c
malloc/mtrace.c

index 736e412a8ac1fad9e1f41c62c01128316dff4ff7..4a00f8220bde746b777749060f93c0e44ec58bd6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+1999-06-17  Andreas Jaeger  <aj@arthur.rhein-neckar.de>
+
+       * elf/dl-load.c (_dl_init_paths): Add one more element to aelem
+       to not write beyond allocated memory.
+       Reported by John Reiser <jreiser@BitWagon.com>, closes PR libc/1167.
+
+1999-06-17  Ulrich Drepper  <drepper@cygnus.com>
+
+       * malloc/mtrace.c: Keep lock while printing output lines.
+       Patch by carsten.zimmermann@mediaways.net [PR libc/1166].
+
 1999-06-16  Ulrich Drepper  <drepper@cygnus.com>
 
        * configure.in: Add warnings about broken code.
index 5ed5128ef577eb68d886b20fbbd2f0ba5f60114e..a0448e9091d3a91b15b08be346e6762e181cf71a 100644 (file)
@@ -513,7 +513,7 @@ _dl_init_paths (const char *llp)
 
   /* First set up the rest of the default search directory entries.  */
   aelem = rtld_search_dirs = (struct r_search_path_elem **)
-    malloc ((sizeof (system_dirs_len) / sizeof (system_dirs_len[0]))
+    malloc ((sizeof (system_dirs_len) / sizeof (system_dirs_len[0]) + 1)
             * sizeof (struct r_search_path_elem *));
   if (rtld_search_dirs == NULL)
     _dl_signal_error (ENOMEM, NULL, "cannot create search path array");
index 6af064c6ced4271185317bfcaae4d9a0e0b0872d..c539cb47eabf6b528bc90ef687a3840ab7a54a8e 100644 (file)
@@ -127,9 +127,11 @@ tr_freehook (ptr, caller)
      __ptr_t ptr;
      const __ptr_t caller;
 {
+  __libc_lock_lock (lock);
   tr_where (caller);
   /* Be sure to print it first.  */
   fprintf (mallstream, "- %p\n", ptr);
+  __libc_lock_unlock (lock);
   if (ptr == mallwatch)
     tr_break ();
   __libc_lock_lock (lock);
@@ -159,12 +161,12 @@ tr_mallochook (size, caller)
     hdr = (__ptr_t) malloc (size);
   __malloc_hook = tr_mallochook;
 
-  __libc_lock_unlock (lock);
-
   tr_where (caller);
   /* We could be printing a NULL here; that's OK.  */
   fprintf (mallstream, "+ %p %#lx\n", hdr, (unsigned long int) size);
 
+  __libc_lock_unlock (lock);
+
   if (hdr == mallwatch)
     tr_break ();
 
@@ -196,8 +198,6 @@ tr_reallochook (ptr, size, caller)
   __malloc_hook = tr_mallochook;
   __realloc_hook = tr_reallochook;
 
-  __libc_lock_unlock (lock);
-
   tr_where (caller);
   if (hdr == NULL)
     /* Failed realloc.  */
@@ -211,6 +211,8 @@ tr_reallochook (ptr, size, caller)
       fprintf (mallstream, "> %p %#lx\n", hdr, (unsigned long int) size);
     }
 
+  __libc_lock_unlock (lock);
+
   if (hdr == mallwatch)
     tr_break ();