This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[COMMITTED] elf/dl-open.c (dl_open_worker): memset all of seen array.
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>, Don Hatch <hatch at plunk dot org>
- Date: Sat, 06 Apr 2013 17:05:55 -0400
- Subject: [COMMITTED] elf/dl-open.c (dl_open_worker): memset all of seen array.
Pointed out by Don Hatch.
Tested on i686 and x86_64 with no regressions.
Makes sure we memset to zero all of the seen array.
It's likely this is almost always zero to begin with, but
could lead to odd behaviour when it's not. Thus we haven't
seen any problems in the wild, but it's wrong and needs to
be fixed.
I've committed this as obvious, updated the issue, and
added it to NEWS.
2013-04-06 Carlos O'Donell <carlos@redhat.com>
[BZ #15309]
* elf/dl-open.c (dl_open_worker): memset all of seen array.
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 201d95d..9ff5f57 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -344,7 +344,7 @@ dl_open_worker (void *a)
if (nmaps > 1)
{
uint16_t seen[nmaps];
- memset (seen, '\0', nmaps);
+ memset (seen, '\0', sizeof (seen));
size_t i = 0;
while (1)
{
---
Cheers,
Carlos.