mirror of
https://gitdl.cn/https://github.com/chakralinux/core.git
synced 2025-01-24 18:42:14 +08:00
29 lines
740 B
Diff
29 lines
740 B
Diff
--- b/elf/dl-close.c
|
|
+++ b/elf/dl-close.c
|
|
@@ -222,7 +222,8 @@
|
|
}
|
|
|
|
/* Sort the entries. */
|
|
- _dl_sort_fini (ns->_ns_loaded, maps, nloaded, used, nsid);
|
|
+ if (nloaded > 1)
|
|
+ _dl_sort_fini (ns->_ns_loaded, maps, nloaded, used, nsid);
|
|
|
|
/* Call all termination functions at once. */
|
|
#ifdef SHARED
|
|
--- b/elf/dl-deps.c
|
|
+++ b/elf/dl-deps.c
|
|
@@ -619,11 +619,11 @@
|
|
|
|
/* We can skip looking for the binary itself which is at the front
|
|
of the search list. */
|
|
- assert (nlist > 1);
|
|
+ assert (nlist > 0);
|
|
i = 1;
|
|
bool seen[nlist];
|
|
memset (seen, false, nlist * sizeof (seen[0]));
|
|
- while (1)
|
|
+ while (nlist > 1)
|
|
{
|
|
/* Keep track of which object we looked at this round. */
|
|
seen[i] = true;
|