[PATCH] dl-lookup.c fix

Jakub Jelinek jakub@redhat.com
Mon May 8 05:36:00 GMT 2000


Hi!

We used to write in memory we did not own :(.
I'll see if some other memory problems are not pending...

2000-05-08  Jakub Jelinek  <jakub@redhat.com>

	* elf/dl-lookup.c (add_dependency): Reallocate l_reldeps in
	sizeof(struct link_map *) chunks, not in bytes.

--- libc/elf/dl-lookup.c.jj	Mon May  8 08:22:14 2000
+++ libc/elf/dl-lookup.c	Mon May  8 14:24:09 2000
@@ -137,7 +137,8 @@ add_dependency (struct link_map *undef_m
 
 		  undef_map->l_reldepsmax += 5;
 		  newp = realloc (undef_map->l_reldeps,
-				  undef_map->l_reldepsmax);
+				  undef_map->l_reldepsmax
+				  * sizeof(struct link_map *));
 
 		  if (__builtin_expect (newp != NULL, 1))
 		    undef_map->l_reldeps = (struct link_map **) newp;

	Jakub


More information about the Libc-hacker mailing list