From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com> Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41134 --- dlls/advapi32/tests/security.c | 10 ++++++++++ dlls/sechost/security.c | 3 +++ 2 files changed, 13 insertions(+) diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index b565526725f..9f76ec54209 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -4271,6 +4271,16 @@ static void test_ConvertStringSecurityDescriptor(void) "ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %lu\n", GetLastError()); if (ret) LocalFree(pSD); + SetLastError(0xdeadbeef); + ret = ConvertStringSecurityDescriptorToSecurityDescriptorA( + "D: (D;OICI;GA;;;BG) (D;OICI;GA;;;AN) (A;OICI;GAGRGWGX;;;AU) (A;OICI;GA;;;BA)", SDDL_REVISION_1, &pSD, NULL); + ok(ret || broken(!ret && GetLastError() == ERROR_INVALID_DATATYPE) /* win2k */, + "ConvertStringSecurityDescriptorToSecurityDescriptor failed with error %lu\n", GetLastError()); + acl = (ACL *)((char *)pSD + sizeof(SECURITY_DESCRIPTOR_RELATIVE)); + ok(acl->AclSize == sizeof(*acl) * 12 /* 96 */, "got %u\n", acl->AclSize); + ok(acl->AceCount = 4, "got %u\n", acl->AceCount); + if (ret) LocalFree(pSD); + /* empty DACL */ size = 0; SetLastError(0xdeadbeef); diff --git a/dlls/sechost/security.c b/dlls/sechost/security.c index 90e227b2948..9f5370a9f53 100644 --- a/dlls/sechost/security.c +++ b/dlls/sechost/security.c @@ -1034,6 +1034,9 @@ static BOOL parse_acl( const WCHAR *string, DWORD *flags, ACL *acl, DWORD *ret_s goto err; string++; + while (*string == ' ') + string++; + acesize = sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD) + sidlen; length += acesize; if (ace) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11026