mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[KMTESTS:SE] Don't modify internal data structure, this might cause buffer overrun.
This commit is contained in:
parent
206df96bc4
commit
ff410211e9
1 changed files with 6 additions and 4 deletions
|
@ -229,6 +229,7 @@ START_TEST(SeQueryInfoToken)
|
||||||
NTSTATUS Status = STATUS_SUCCESS;
|
NTSTATUS Status = STATUS_SUCCESS;
|
||||||
PAUX_ACCESS_DATA AuxData = NULL;
|
PAUX_ACCESS_DATA AuxData = NULL;
|
||||||
PPRIVILEGE_SET NewPrivilegeSet;
|
PPRIVILEGE_SET NewPrivilegeSet;
|
||||||
|
ULONG InitialPrivilegeCount;
|
||||||
BOOLEAN Checker;
|
BOOLEAN Checker;
|
||||||
PPRIVILEGE_SET Privileges = NULL;
|
PPRIVILEGE_SET Privileges = NULL;
|
||||||
PSECURITY_SUBJECT_CONTEXT SubjectContext = NULL;
|
PSECURITY_SUBJECT_CONTEXT SubjectContext = NULL;
|
||||||
|
@ -278,7 +279,8 @@ START_TEST(SeQueryInfoToken)
|
||||||
// Testing SeAppendPrivileges //
|
// Testing SeAppendPrivileges //
|
||||||
//----------------------------------------------------------------//
|
//----------------------------------------------------------------//
|
||||||
|
|
||||||
AuxData->PrivilegeSet->PrivilegeCount = 1;
|
InitialPrivilegeCount = AuxData->PrivilegeSet->PrivilegeCount;
|
||||||
|
trace("Initial privilege count = %lu\n", InitialPrivilegeCount);
|
||||||
|
|
||||||
// Testing SeAppendPrivileges. Must change PrivilegeCount to 2 (1 + 1)
|
// Testing SeAppendPrivileges. Must change PrivilegeCount to 2 (1 + 1)
|
||||||
|
|
||||||
|
@ -289,7 +291,7 @@ START_TEST(SeQueryInfoToken)
|
||||||
|
|
||||||
Status = SeAppendPrivileges(AccessState, NewPrivilegeSet);
|
Status = SeAppendPrivileges(AccessState, NewPrivilegeSet);
|
||||||
ok(Status == STATUS_SUCCESS, "SeAppendPrivileges failed\n");
|
ok(Status == STATUS_SUCCESS, "SeAppendPrivileges failed\n");
|
||||||
ok((AuxData->PrivilegeSet->PrivilegeCount == 2),"PrivelegeCount must be 2, but it is %d\n", AuxData->PrivilegeSet->PrivilegeCount);
|
ok_eq_ulong(AuxData->PrivilegeSet->PrivilegeCount, InitialPrivilegeCount + 1);
|
||||||
ExFreePoolWithTag(NewPrivilegeSet, 'QSmK');
|
ExFreePoolWithTag(NewPrivilegeSet, 'QSmK');
|
||||||
|
|
||||||
//----------------------------------------------------------------//
|
//----------------------------------------------------------------//
|
||||||
|
@ -303,7 +305,7 @@ START_TEST(SeQueryInfoToken)
|
||||||
|
|
||||||
Status = SeAppendPrivileges(AccessState, NewPrivilegeSet);
|
Status = SeAppendPrivileges(AccessState, NewPrivilegeSet);
|
||||||
ok(Status == STATUS_SUCCESS, "SeAppendPrivileges failed\n");
|
ok(Status == STATUS_SUCCESS, "SeAppendPrivileges failed\n");
|
||||||
ok((AuxData->PrivilegeSet->PrivilegeCount == 6),"PrivelegeCount must be 6, but it is %d\n", AuxData->PrivilegeSet->PrivilegeCount);
|
ok_eq_ulong(AuxData->PrivilegeSet->PrivilegeCount, InitialPrivilegeCount + 5);
|
||||||
ExFreePoolWithTag(NewPrivilegeSet, 'QSmK');
|
ExFreePoolWithTag(NewPrivilegeSet, 'QSmK');
|
||||||
|
|
||||||
//----------------------------------------------------------------//
|
//----------------------------------------------------------------//
|
||||||
|
@ -373,7 +375,7 @@ START_TEST(SeQueryInfoToken)
|
||||||
NewPrivilegeSet->PrivilegeCount = 14;
|
NewPrivilegeSet->PrivilegeCount = 14;
|
||||||
|
|
||||||
ok((SeAppendPrivileges(AccessState, NewPrivilegeSet)) == STATUS_SUCCESS, "SeAppendPrivileges failed\n");
|
ok((SeAppendPrivileges(AccessState, NewPrivilegeSet)) == STATUS_SUCCESS, "SeAppendPrivileges failed\n");
|
||||||
ok((AuxData->PrivilegeSet->PrivilegeCount == 20),"PrivelegeCount must be 20, but it is %d\n", AuxData->PrivilegeSet->PrivilegeCount);
|
ok_eq_ulong(AuxData->PrivilegeSet->PrivilegeCount, InitialPrivilegeCount + 19);
|
||||||
ExFreePoolWithTag(NewPrivilegeSet, 'QSmK');
|
ExFreePoolWithTag(NewPrivilegeSet, 'QSmK');
|
||||||
for (i = 0; i < AuxData->PrivilegeSet->PrivilegeCount; i++)
|
for (i = 0; i < AuxData->PrivilegeSet->PrivilegeCount; i++)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue