SHA256
1
0
forked from pool/glibc
glibc/glibc-sw13618-2.patch

30 lines
799 B
Diff

Index: glibc-2.15/elf/dl-open.c
===================================================================
--- glibc-2.15.orig/elf/dl-open.c
+++ glibc-2.15/elf/dl-open.c
@@ -326,7 +326,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)
@@ -352,13 +352,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;