Merge pull request #9 from omega13a/patch-8

Update 0001-ntdll-Do-not-allow-to-allocate-thread-stack-for-curr.patch
This commit is contained in:
Alistair Leslie-Hughes 2018-02-18 13:47:40 +11:00 committed by GitHub
commit 55cb3e6d00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,23 +21,6 @@ index ba296d25c3c..faa258a27f4 100644
};
C_ASSERT( sizeof(struct ntdll_thread_data) <= sizeof(((TEB *)0)->GdiTebBatch) );
diff --git a/dlls/ntdll/thread.c b/dlls/ntdll/thread.c
index ba1be0f3d8a..e8f07efb829 100644
--- a/dlls/ntdll/thread.c
+++ b/dlls/ntdll/thread.c
@@ -445,6 +445,12 @@ void exit_thread( int status )
if (thread_data->pthread_id)
{
pthread_join( thread_data->pthread_id, NULL );
+ if ((ULONG_PTR)thread_data->pthread_stack & 1)
+ {
+ void *addr = (void *)((ULONG_PTR)thread_data->pthread_stack & ~1);
+ SIZE_T size = 0;
+ NtFreeVirtualMemory( GetCurrentProcess(), &addr, &size, MEM_RELEASE );
+ }
signal_free_thread( teb );
}
}
diff --git a/dlls/ntdll/virtual.c b/dlls/ntdll/virtual.c
index 4aeb282adf7..68c0148fbb5 100644
--- a/dlls/ntdll/virtual.c
@ -70,4 +53,3 @@ index 4aeb282adf7..68c0148fbb5 100644
delete_view( view );
--
2.13.1