From 3eaca8526c379d09c13e9a30f45cd7ea6ce886f1 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Fri, 27 Aug 2010 19:57:17 +0000 Subject: [PATCH] Do not call __pthread_cxa_finalize with invalid struct dl_phdr_info. Reported and tested by: Fabian Keil MFC after: 17 days --- lib/libc/stdlib/atexit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libc/stdlib/atexit.c b/lib/libc/stdlib/atexit.c index 97cf2344659..511172aef9a 100644 --- a/lib/libc/stdlib/atexit.c +++ b/lib/libc/stdlib/atexit.c @@ -200,6 +200,6 @@ __cxa_finalize(void *dso) if (dso == NULL) _MUTEX_DESTROY(&atexit_mutex); - if (&__pthread_cxa_finalize != NULL) + if (has_phdr && &__pthread_cxa_finalize != NULL) __pthread_cxa_finalize(&phdr_info); }