undefined4 Set_ACLClearAll_Proc(int *param_1,undefined4 param_2)
{
char cVar1;
undefined4 uVar2;
int iVar3;
void *local_20 [3];
local_20[0] = (void *)0x0;
iVar3 = *param_1;
cVar1 = simple_strtol(param_2,0,10) //possible issue identified - semgrep
if (cVar1 == '\x01') {
os_alloc_mem(0,local_20,0x208);
if (local_20[0] == (void *)0x0) {
if (RTDebugLevel == 0) {
uVar2 = 0;
}
else {
printk("%s: Allocate memory fail!!!\n","Set_ACLClearAll_Proc");
uVar2 = 0;
}
}
else {
memset(local_20[0],0,0x208) //possible issue identified - semgrep
memmove(local_20[0],param_1 + *(int *)(iVar3 + 0xfc) * 0x450 + 0x164a,0x208) //possible issue identified - semgrep
if (*(int *)((int)local_20[0] + 4) == 0) {
if (1 < RTDebugLevel) {
printk("The Access Control List is empty!\n");
}
if (1 < RTDebugLevel) {
printk("No need to clear the Access Control List!\n");
}
if (local_20[0] == (void *)0x0) {
uVar2 = 1;
}
else {
os_free_mem(0);
uVar2 = 1;
}
}
else {
do {
memset((void *)((int)local_20[0] + *(int *)((int)local_20[0] + 4) * 8),0,6) //possible issue identified - semgrep
*(int *)((int)local_20[0] + 4) = *(int *)((int)local_20[0] + 4) + -1;
} while (*(int *)((int)local_20[0] + 4) != 0);
memset(param_1 + *(int *)(iVar3 + 0xfc) * 0x450 + 0x164a,0,0x208) //possible issue identified - semgrep
memmove(param_1 + *(int *)(iVar3 + 0xfc) * 0x450 + 0x164a,local_20[0],0x208) //possible issue identified - semgrep
ApUpdateAccessControlList(param_1,*(undefined1 *)(iVar3 + 0xfc));
if (local_20[0] != (void *)0x0) {
os_free_mem(0);
}
if (RTDebugLevel < 3) {
uVar2 = 1;
}
else {
printk("Set::%s(Policy=%ld, Entry#=%ld)\n","Set_ACLClearAll_Proc",
param_1[*(int *)(iVar3 + 0xfc) * 0x450 + 0x164a],
param_1[*(int *)(iVar3 + 0xfc) * 0x450 + 0x164b]);
uVar2 = 1;
}
}
}
}
else {
uVar2 = 0;
if (cVar1 == '\0') {
if (1 < RTDebugLevel) {
printk("Your input is 0!\n");
}
if (RTDebugLevel < 2) {
uVar2 = 1;
}
else {
printk("The Access Control List will be kept unchanged!\n");
uVar2 = 1;
}
}
}
return uVar2;
}