From 75c94b00a2cd19ba2a1188578b848bfc2c8e8e2e Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 21 Jul 2009 23:33:57 -0400 Subject: linuxthreads.old: fix crash in debug code If pthread_join() is called and there is nothing to join, then the debug code will attempt to dereference a NULL pointer. Signed-off-by: Mike Frysinger --- libpthread/linuxthreads.old/join.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libpthread') diff --git a/libpthread/linuxthreads.old/join.c b/libpthread/linuxthreads.old/join.c index ee3449396..4a7c0d8ac 100644 --- a/libpthread/linuxthreads.old/join.c +++ b/libpthread/linuxthreads.old/join.c @@ -77,7 +77,7 @@ void __pthread_do_exit(void *retval, char *currentframe) THREAD_SETMEM(self, p_terminated, 1); /* See if someone is joining on us */ joining = THREAD_GETMEM(self, p_joining); - PDEBUG("joining = %p, pid=%d\n", joining, joining->p_pid); + PDEBUG("joining = %p, pid=%d\n", joining, joining ? joining->p_pid : 0); __pthread_unlock(THREAD_GETMEM(self, p_lock)); /* Restart joining thread if any */ if (joining != NULL) restart(joining); -- cgit v1.2.3