git: 5cf78a550034 - stable/13 - __cxa_thread_call_dtors(3): fix dtor pointer validity check

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Fri, 10 May 2024 07:49:54 UTC
The branch stable/13 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=5cf78a5500345340771f7eb840724c2422b2ff96

commit 5cf78a5500345340771f7eb840724c2422b2ff96
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2024-05-03 09:32:01 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2024-05-10 07:49:36 +0000

    __cxa_thread_call_dtors(3): fix dtor pointer validity check
    
    PR:     278701
    
    (cherry picked from commit b27eb9ce96b838622e125fd969e8dc4914aabe18)
---
 lib/libc/stdlib/cxa_thread_atexit_impl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/libc/stdlib/cxa_thread_atexit_impl.c b/lib/libc/stdlib/cxa_thread_atexit_impl.c
index 2ebf20ef7fd9..ef9f3567d483 100644
--- a/lib/libc/stdlib/cxa_thread_atexit_impl.c
+++ b/lib/libc/stdlib/cxa_thread_atexit_impl.c
@@ -103,7 +103,7 @@ walk_cb_call(struct cxa_thread_dtor *dtor)
 {
 	struct dl_phdr_info phdr_info;
 
-	if (_rtld_addr_phdr(dtor->dso, &phdr_info) &&
+	if (_rtld_addr_phdr(dtor->func, &phdr_info) &&
 	    __elf_phdr_match_addr(&phdr_info, dtor->func))
 		dtor->func(dtor->obj);
 	else