提交 d56a2375 编写于 作者: J Jonathan Chambers

Fix Win32 call in IsUserProtected. Usage was incorrect and freeing the wrong...

Fix Win32 call in IsUserProtected. Usage was incorrect and freeing the wrong parameter causing a memory corruption.
上级 0699e4da
......@@ -701,9 +701,10 @@ IsUserProtected (gunichar2 *path)
gboolean success = FALSE;
PACL pDACL = NULL;
PSID pEveryoneSid = NULL;
PSECURITY_DESCRIPTOR pSecurityDescriptor = NULL;
DWORD dwRes = GetNamedSecurityInfoW (path, SE_FILE_OBJECT,
DACL_SECURITY_INFORMATION, NULL, NULL, &pDACL, NULL, NULL);
DACL_SECURITY_INFORMATION, NULL, NULL, &pDACL, NULL, &pSecurityDescriptor);
if (dwRes != ERROR_SUCCESS)
return FALSE;
......@@ -720,8 +721,8 @@ IsUserProtected (gunichar2 *path)
/* Note: we don't need to check our own access -
we'll know soon enough when reading the file */
if (pDACL)
LocalFree (pDACL);
if (pSecurityDescriptor)
LocalFree (pSecurityDescriptor);
return success;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册