From 9e17b71fa658f102ecb2f210534070a2328dd6c9 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sun, 26 Jun 2011 22:39:34 -0400 Subject: [PATCH] fix stale pointer issue in dynamic linker with dlopen --- src/ldso/dynlink.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c index 62dd9db7..9a0697c8 100644 --- a/src/ldso/dynlink.c +++ b/src/ldso/dynlink.c @@ -473,6 +473,7 @@ void *__dynlink(int argc, char **argv, size_t *got) *libc->prev->next = *libc; libc = libc->prev->next; if (libc->next) libc->next->prev = libc; + if (tail == &lib) tail = libc; } else { free_all(head); free(sys_path); -- GitLab