+2013-05-30 Corinna Vinschen <corinna@...>
+
+ * cygdrop.cc (main): Use correct procedure to
+ allocate space for security token.
+
2013-05-30 Charles Wilson <cwilson@...>
Post-release version bump 1.4.13
+1.4.14
+ * cygdrop: Fix bug in obtaining security token information
+ Patch from Corinna Vinschen, reported by Achim Gratz.
+
1.4.12
* winln: new ln workalike that produces "native" windows
shortcuts. Daniel Colascione.
return winerror("OpenProcessToken");
// Get groups.
- char groups_buf[sizeof(DWORD) + max_groups * sizeof(SID_AND_ATTRIBUTES)];
- TOKEN_GROUPS * groups = (TOKEN_GROUPS *)groups_buf;
DWORD size = 0;
+ if (!GetTokenInformation (proc_token, TokenGroups, NULL, 0, &size)
+ && GetLastError () != ERROR_INSUFFICIENT_BUFFER)
+ return winerror ("GetTokenInformation");
+
+ char groups_buf[size];
+ TOKEN_GROUPS * groups = (TOKEN_GROUPS *)groups_buf;
if (!GetTokenInformation (proc_token, TokenGroups, groups, sizeof(groups_buf), &size))
return winerror ("GetTokenInformation");