1
0
Fork 0

Use strncpy_s with _TRUNCATE flag

This commit is contained in:
Forsari0 2016-08-20 14:51:25 +03:00 committed by mrexodia
parent 0b55e90b27
commit 67cf947fd5
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
1 changed files with 2 additions and 4 deletions

View File

@ -174,10 +174,8 @@ bool _getprocesslist(DBGPROCESSINFO** entries, int* count)
for(int i = 0; i < *count; i++)
{
(*entries)[*count - i - 1].dwProcessId = infoList.at(i).th32ProcessID;
strncpy((*entries)[*count - i - 1].szExeFile, infoList.at(i).szExeFile, MAX_PATH);
strncpy((*entries)[*count - i - 1].szExeArgs, commandList.at(i).c_str(), MAX_COMMAND_LINE_SIZE);
(*entries)[*count - i - 1].szExeFile[MAX_PATH - 1] = '\0';
(*entries)[*count - i - 1].szExeArgs[MAX_COMMAND_LINE_SIZE - 1] = '\0';
strncpy_s((*entries)[*count - i - 1].szExeFile, infoList.at(i).szExeFile, _TRUNCATE);
strncpy_s((*entries)[*count - i - 1].szExeArgs, commandList.at(i).c_str(), _TRUNCATE);
}
return true;
}