This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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.


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