Test whether passed index is valid in TlsFree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

currently TlsFree(0xFFFFFFFF) crashes. This patch adds
a sanity check for the passed index value.

Changelog:
    Dmitry Timoshkov <dmitry@xxxxxxxxxxxxxxx>
    Test whether passed index is valid in TlsFree.

--- cvs/hq/wine/dlls/kernel/process.c	Tue Nov 25 12:17:42 2003
+++ wine/dlls/kernel/process.c	Thu Nov 27 21:16:30 2003
@@ -1910,6 +1910,12 @@ BOOL WINAPI TlsFree(
 {
     BOOL ret;
 
+    if (index >= NtCurrentTeb()->Peb->TlsBitmap->SizeOfBitMap)
+    {
+        SetLastError( ERROR_INVALID_PARAMETER );
+        return FALSE;
+    }
+
     RtlAcquirePebLock();
     ret = RtlAreBitsSet( NtCurrentTeb()->Peb->TlsBitmap, index, 1 );
     if (ret)





[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux