This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH][BZ #15308] _dl_sort_fini reads memory already freed in dl-libc.c's libc_freeres
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: libc-alpha at sourceware dot org
- Date: Fri, 11 Oct 2013 20:15:57 +0200
- Subject: [PATCH][BZ #15308] _dl_sort_fini reads memory already freed in dl-libc.c's libc_freeres
- Authentication-results: sourceware.org; auth=none
Hi,
A following patch was described at bugzilla by Don Hatch.
OK to commit?
* elf/dl-libc.c (libc_freeres_fn): Fix invalid read.
diff --git a/elf/dl-libc.c b/elf/dl-libc.c
index aba0d1a..397d898 100644
--- a/elf/dl-libc.c
+++ b/elf/dl-libc.c
@@ -286,6 +286,7 @@ libc_freeres_fn (free_mem)
/* Free the initfini dependency list. */
if (l->l_free_initfini)
free (l->l_initfini);
+ l->l_initfini = NULL;
}
if (__builtin_expect (GL(dl_ns)[ns]._ns_global_scope_alloc, 0) != 0