Update amtinfo, usage and admin check. General code cleanup and bug fixes.

This commit is contained in:
Mudit Vats
2020-10-30 09:51:18 -07:00
parent eb42f1e89d
commit 6d2e37e7fc
13 changed files with 434 additions and 148 deletions

View File

@@ -898,7 +898,7 @@ AMT_STATUS pthi_GetRemoteAccessConnectionStatus(REMOTE_ACCESS_STATUS *remoteAcce
AMT_STATUS _verifyRemoteAccessConnectionStatus(const CFG_GET_REMOTE_ACCESS_CONNECTION_STATUS_RESPONSE *response)
{
ULONG ByteCount = response->Header.Header.Length;
if (ByteCount != (sizeof(CFG_GET_REMOTE_ACCESS_CONNECTION_STATUS_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER) - sizeof(CHAR *) + response->MpsHostname.Length)) return PTSDK_STATUS_INTERNAL_ERROR;
if (ByteCount < (sizeof(CFG_GET_REMOTE_ACCESS_CONNECTION_STATUS_RESPONSE) - sizeof(PTHI_MESSAGE_HEADER) - sizeof(CHAR*))) return PTSDK_STATUS_INTERNAL_ERROR;
return AMT_STATUS_SUCCESS;
}
@@ -1347,7 +1347,7 @@ AMT_STATUS pthi_SetHostFQDN(char* str)
AMT_STATUS status;
UINT8 *readBuffer = NULL;
CFG_SET_HOST_FQDN_REQUEST command;
int len = (int)strnlen_s(str, _MAX_PATH);
int len = (int)strnlen_s(str, 256);
memset(&command, 0, sizeof(CFG_SET_HOST_FQDN_REQUEST)); // Fix the valgrind warning
command.Header = SET_HOST_FQDN_HEADER;

View File

@@ -2441,8 +2441,8 @@ ILibExportMethod void ILibStartChain(void *Chain)
//
// Free the pipe resources
//
fclose(((ILibBaseChain*)Chain)->TerminateReadPipe);
fclose(((ILibBaseChain*)Chain)->TerminateWritePipe);
if (((ILibBaseChain*)Chain)->TerminateReadPipe != NULL) {fclose(((ILibBaseChain*)Chain)->TerminateReadPipe);}
if (((ILibBaseChain*)Chain)->TerminateWritePipe != NULL) {fclose(((ILibBaseChain*)Chain)->TerminateWritePipe);}
((ILibBaseChain*)Chain)->TerminateReadPipe=0;
((ILibBaseChain*)Chain)->TerminateWritePipe=0;
#endif