Update of /cvsroot/pywin32/pywin32/win32/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv800
Modified Files:
win32security.i
Log Message:
* GetBinarySid() would crash for huge strings, and OpenProcessToken()
returns a PyHANDLE so it will be automatically closed.
Index: win32security.i
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/src/win32security.i,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** win32security.i 1 Sep 2004 05:07:58 -0000 1.19
--- win32security.i 1 Oct 2004 00:16:20 -0000 1.20
***************
*** 697,700 ****
--- 697,704 ----
ZeroMemory(&identAuthority, sizeof(identAuthority));
+ /* avoid buffer overflows */
+ if (lstrlen(TextualSid) >= sizeof(buffer)/sizeof(buffer[0]))
+ return NULL;
+
lstrcpy(buffer, TextualSid);
***************
*** 987,995 ****
%}
! // @pyswig int|OpenProcessToken|
BOOLAPI OpenProcessToken(
PyHANDLE ProcessHandle, // @pyparm int|processHandle||The handle of the process to open.
DWORD DesiredAccess, // @pyparm int|desiredAccess||Desired access to process
! HANDLE *OUTPUT
);
--- 991,999 ----
%}
! // @pyswig <o PyHANDLE>|OpenProcessToken|Opens the access token associated with a process.
BOOLAPI OpenProcessToken(
PyHANDLE ProcessHandle, // @pyparm int|processHandle||The handle of the process to open.
DWORD DesiredAccess, // @pyparm int|desiredAccess||Desired access to process
! PyHANDLE *OUTPUT
);
|