changeset 1968:0b33f0736406

6837842: JNI_CreateJavaVM crashes under impersonation Reviewed-by: acorn, dholmes
author poonam
date Fri, 19 Nov 2010 03:41:50 -0800
parents 22260322f0be
children a6b067997c7e
files src/os/windows/vm/perfMemory_windows.cpp
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/windows/vm/perfMemory_windows.cpp	Thu Nov 18 14:37:46 2010 -0500
+++ b/src/os/windows/vm/perfMemory_windows.cpp	Fri Nov 19 03:41:50 2010 -0800
@@ -889,6 +889,7 @@
   DWORD newACLsize = aclinfo.AclBytesInUse +
                         (sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) * ace_count;
   for (int i = 0; i < ace_count; i++) {
+     assert(aces[i].pSid != 0, "pSid should not be 0");
      newACLsize += GetLengthSid(aces[i].pSid);
   }
 
@@ -1084,6 +1085,9 @@
   aces[0].pSid = get_user_sid(GetCurrentProcess());
   aces[0].mask = umask;
 
+  if (aces[0].pSid == 0)
+    return NULL;
+
   // get the well known SID for BUILTIN\Administrators
   PSID administratorsSid = NULL;
   SID_IDENTIFIER_AUTHORITY SIDAuthAdministrators = SECURITY_NT_AUTHORITY;