1
0
Fork 0

DBG: fix some truncation issues

This commit is contained in:
Duncan Ogilvie 2017-12-19 04:07:54 +01:00
parent 058c14d8bf
commit 995153cfc0
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
3 changed files with 4 additions and 4 deletions

View File

@ -290,8 +290,8 @@ static bool _gethandlename(duint handle, char* name, size_t nameSize, char* type
String typeNameS;
if(!HandlesGetName(fdProcessInfo->hProcess, HANDLE(handle), nameS, typeNameS))
return false;
strcpy_s(name, nameSize, nameS.c_str());
strcpy_s(typeName, typeNameSize, typeNameS.c_str());
strncpy_s(name, nameSize, nameS.c_str(), _TRUNCATE);
strncpy_s(typeName, typeNameSize, typeNameS.c_str(), _TRUNCATE);
return true;
}

View File

@ -202,7 +202,7 @@ static bool getLabel(duint addr, char* label, bool noFuncOffset)
//auto name = demanglePE32ExternCFunc(symInfo.decoratedName.c_str());
if(!bUndecorateSymbolNames || !SafeUnDecorateSymbolName(symInfo.decoratedName.c_str(), label, MAX_LABEL_SIZE, UNDNAME_NAME_ONLY))
{
strcpy_s(label, MAX_LABEL_SIZE, symInfo.decoratedName.c_str());
strncpy_s(label, MAX_LABEL_SIZE, symInfo.decoratedName.c_str(), _TRUNCATE);
}
retval = !shouldFilterSymbol(label);
if(retval && displacement)

View File

@ -327,7 +327,7 @@ bool SymGetSourceLine(duint Cip, char* FileName, int* Line, DWORD* disp)
*Line = lineInfo.lineNumber;
if(FileName)
strcpy_s(FileName, MAX_STRING_SIZE, lineInfo.sourceFile.c_str());
strncpy_s(FileName, MAX_STRING_SIZE, lineInfo.sourceFile.c_str(), _TRUNCATE);
return true;
}