Skip to content

Commit cf4aa7e

Browse files
committed
[LSASRV] Fix usage of self-relative security descriptor in LsarQuerySecurityObject
1 parent 5127433 commit cf4aa7e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

dll/win32/lsasrv/lsarpc.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ LsarQuerySecurityObject(
201201
PLSAPR_SR_SECURITY_DESCRIPTOR *SecurityDescriptor)
202202
{
203203
PLSA_DB_OBJECT DbObject = NULL;
204-
PSECURITY_DESCRIPTOR RelativeSd = NULL;
204+
PISECURITY_DESCRIPTOR_RELATIVE RelativeSd = NULL;
205205
PSECURITY_DESCRIPTOR ResultSd = NULL;
206206
PLSAPR_SR_SECURITY_DESCRIPTOR SdData = NULL;
207207
ACCESS_MASK DesiredAccess = 0;
@@ -256,16 +256,16 @@ LsarQuerySecurityObject(
256256

257257
/* Invalidate the SD information that was not requested */
258258
if (!(SecurityInformation & OWNER_SECURITY_INFORMATION))
259-
((PISECURITY_DESCRIPTOR)RelativeSd)->Owner = NULL;
259+
RelativeSd->Owner = 0;
260260

261261
if (!(SecurityInformation & GROUP_SECURITY_INFORMATION))
262-
((PISECURITY_DESCRIPTOR)RelativeSd)->Group = NULL;
262+
RelativeSd->Group = 0;
263263

264264
if (!(SecurityInformation & DACL_SECURITY_INFORMATION))
265-
((PISECURITY_DESCRIPTOR)RelativeSd)->Control &= ~SE_DACL_PRESENT;
265+
RelativeSd->Control &= ~SE_DACL_PRESENT;
266266

267267
if (!(SecurityInformation & SACL_SECURITY_INFORMATION))
268-
((PISECURITY_DESCRIPTOR)RelativeSd)->Control &= ~SE_SACL_PRESENT;
268+
RelativeSd->Control &= ~SE_SACL_PRESENT;
269269

270270
/* Calculate the required SD size */
271271
Status = RtlMakeSelfRelativeSD(RelativeSd,
@@ -298,7 +298,7 @@ LsarQuerySecurityObject(
298298
}
299299

300300
/* Fill the SD data buffer and return it to the caller */
301-
SdData->Length = RelativeSdSize;
301+
SdData->Length = ResultSdSize;
302302
SdData->SecurityDescriptor = (PBYTE)ResultSd;
303303

304304
*SecurityDescriptor = SdData;

0 commit comments

Comments
 (0)