* threads.c: Fix access to freed members of a dead thread. Found
and fixed by Rodrigo Kumpera <rkumpera@novell.com>
Ref: CVE-2011-0992
CloseHandle (thread);
if (this->synch_cs) {
CloseHandle (thread);
if (this->synch_cs) {
- DeleteCriticalSection (this->synch_cs);
- g_free (this->synch_cs);
+ CRITICAL_SECTION *synch_cs = this->synch_cs;
+ DeleteCriticalSection (synch_cs);
+ g_free (synch_cs);
+ if (this->name) {
+ void *name = this->name;
+ this->name = NULL;
+ g_free (name);
+ }
}
static void mono_thread_start (MonoThread *thread)
}
static void mono_thread_start (MonoThread *thread)