summaryrefslogtreecommitdiff
path: root/libc/elf
diff options
context:
space:
mode:
Diffstat (limited to 'libc/elf')
-rw-r--r--libc/elf/dl-deps.c8
-rw-r--r--libc/elf/dl-fini.c8
-rw-r--r--libc/elf/dl-open.c8
3 files changed, 12 insertions, 12 deletions
diff --git a/libc/elf/dl-deps.c b/libc/elf/dl-deps.c
index e0b5ecb09..d7560e8e5 100644
--- a/libc/elf/dl-deps.c
+++ b/libc/elf/dl-deps.c
@@ -1,5 +1,5 @@
/* Load the dependencies of a mapped object.
- Copyright (C) 1996-2003, 2004, 2005, 2006, 2007, 2010, 2011
+ Copyright (C) 1996-2003, 2004-2007, 2010-2012
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -632,7 +632,7 @@ Filters not supported with LD_TRACE_PRELINKING"));
/* We can skip looking for the binary itself which is at the front
of the search list. */
i = 1;
- char seen[nlist];
+ uint16_t seen[nlist];
memset (seen, 0, nlist * sizeof (seen[0]));
while (1)
{
@@ -658,13 +658,13 @@ Filters not supported with LD_TRACE_PRELINKING"));
(k - i) * sizeof (l_initfini[0]));
l_initfini[k] = thisp;
- if (seen[i + 1] > 1)
+ if (seen[i + 1] > nlist - i)
{
++i;
goto next_clear;
}
- char this_seen = seen[i];
+ uint16_t this_seen = seen[i];
memmove (&seen[i], &seen[i + 1],
(k - i) * sizeof (seen[0]));
seen[k] = this_seen;
diff --git a/libc/elf/dl-fini.c b/libc/elf/dl-fini.c
index 5f40c87a7..717979c31 100644
--- a/libc/elf/dl-fini.c
+++ b/libc/elf/dl-fini.c
@@ -1,5 +1,5 @@
/* Call the termination functions of loaded shared objects.
- Copyright (C) 1995,96,1998-2002,2004-2005,2009,2011
+ Copyright (C) 1995, 1996, 1998-2002, 2004-2005, 2009, 2011-2012
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -38,7 +38,7 @@ _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used, Lmid_t ns)
/* We can skip looking for the binary itself which is at the front
of the search list for the main namespace. */
unsigned int i = ns == LM_ID_BASE;
- char seen[nmaps];
+ uint16_t seen[nmaps];
memset (seen, 0, nmaps * sizeof (seen[0]));
while (1)
{
@@ -78,13 +78,13 @@ _dl_sort_fini (struct link_map **maps, size_t nmaps, char *used, Lmid_t ns)
used[k] = here_used;
}
- if (seen[i + 1] > 1)
+ if (seen[i + 1] > nmaps - i)
{
++i;
goto next_clear;
}
- char this_seen = seen[i];
+ uint16_t this_seen = seen[i];
memmove (&seen[i], &seen[i + 1], (k - i) * sizeof (seen[0]));
seen[k] = this_seen;
diff --git a/libc/elf/dl-open.c b/libc/elf/dl-open.c
index 45a70aeaf..32ae5cffe 100644
--- a/libc/elf/dl-open.c
+++ b/libc/elf/dl-open.c
@@ -1,5 +1,5 @@
/* Load a shared object at runtime, relocate it, and run its initializer.
- Copyright (C) 1996-2007, 2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1996-2007, 2009-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -325,7 +325,7 @@ dl_open_worker (void *a)
while (l != NULL);
if (nmaps > 1)
{
- char seen[nmaps];
+ uint16_t seen[nmaps];
memset (seen, '\0', nmaps);
size_t i = 0;
while (1)
@@ -351,13 +351,13 @@ dl_open_worker (void *a)
(k - i) * sizeof (maps[0]));
maps[k] = thisp;
- if (seen[i + 1] > 1)
+ if (seen[i + 1] > nmaps - i)
{
++i;
goto next_clear;
}
- char this_seen = seen[i];
+ uint16_t this_seen = seen[i];
memmove (&seen[i], &seen[i + 1],
(k - i) * sizeof (seen[0]));
seen[k] = this_seen;