Compare commits

...

2 Commits

Author SHA1 Message Date
Sami Vänttinen b501012936
Merge 62b5e10be5 into e7aa09276e 2024-05-21 15:58:34 +03:00
Mounir IDRASSI e7aa09276e
Fix wrong DACL memory size on Windows (createWindowsDACL) (#10712)
Each AddAccessAllowedAce invocation should be matched with a corresponding sizeof(ACCESS_ALLOWED_ACE) and the respective GetLengthSid of the SID being used. This ensures that there is enough space in the ACL for each entry.

The issue manifest itself only when WITH_XC_SSHAGENT is defined.
2024-05-21 11:17:43 +02:00
1 changed files with 2 additions and 1 deletions

View File

@ -180,7 +180,8 @@ namespace Bootstrap
// Calculate the amount of memory that must be allocated for the DACL
cbACL = sizeof(ACL) + sizeof(ACCESS_ALLOWED_ACE) + GetLengthSid(pTokenUser->User.Sid)
+ sizeof(ACCESS_ALLOWED_ACE) + GetLengthSid(pLocalSystemSid) + GetLengthSid(pOwnerRightsSid);
+ sizeof(ACCESS_ALLOWED_ACE) + GetLengthSid(pLocalSystemSid) + sizeof(ACCESS_ALLOWED_ACE)
+ GetLengthSid(pOwnerRightsSid);
// Create and initialize an ACL
pACL = static_cast<PACL>(HeapAlloc(GetProcessHeap(), 0, cbACL));