This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] dl-lookup.c fix


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]