int RTMPReadParametersHook(int param_1)
{
uint uVar1;
int iVar2;
char *pcVar3;
void *local_20;
undefined1 auStack_1c [12];
os_alloc_mem(param_1,&local_20,0x1000);
iVar2 = 1;
if (local_20 != (void *)0x0) {
memset(local_20,0,0x1000) //possible issue identified - semgrep
if (*(int *)(param_1 + 0x29f8) == 4) {
pcVar3 = "/var/run/RT2860.dat";
}
else {
pcVar3 = "/etc/Wireless/RT2860AP/RT2860AP.dat";
}
RtmpOSFSInfoChange(auStack_1c,1);
uVar1 = RtmpOSFileOpen(pcVar3,0,0) //possible issue identified - semgrep
if ((uVar1 == 0) || (0xfffff000 < uVar1)) {
if (RTDebugLevel == 0) {
iVar2 = 1;
}
else {
printk("Open file \"%s\" failed!\n",pcVar3);
iVar2 = 1;
}
}
else {
iVar2 = RtmpOSFileRead(uVar1,local_20,0x1000) //possible issue identified - semgrep
if (iVar2 < 1) {
if (RTDebugLevel != 0) {
printk("Read file \"%s\" failed(errCode=%d)!\n",pcVar3,iVar2);
}
}
else {
RTMPSetProfileParameters(param_1,local_20);
}
iVar2 = RtmpOSFileClose(uVar1);
if ((iVar2 != 0) && (iVar2 = 1, RTDebugLevel != 0)) {
printk("Close file \"%s\" failed(errCode=%d)!\n",pcVar3,1);
iVar2 = 1;
}
}
RtmpOSFSInfoChange(auStack_1c,0);
os_free_mem(0,local_20);
}
return iVar2;
}