1
0
Fork 0

DBG: fixed invalid CRT parameters

This commit is contained in:
mrexodia 2016-06-24 07:56:39 +02:00
parent 4c35ed2a8d
commit 11006848c4
No known key found for this signature in database
GPG Key ID: D72F9A4FAA0073B4
4 changed files with 4 additions and 4 deletions

View File

@ -531,7 +531,7 @@ extern "C" DLL_EXPORT bool _dbg_getregdump(REGDUMP* regdump)
Getx87StatusWordFields(& (regdump->x87StatusWordFields), regdump->regcontext.x87fpu.StatusWord);
LASTERROR lastError;
lastError.code = ThreadGetLastError(ThreadGetId(hActiveThread));
strcpy_s(lastError.name, _TRUNCATE, ErrorCodeToName(lastError.code).c_str());
strncpy_s(lastError.name, ErrorCodeToName(lastError.code).c_str(), _TRUNCATE);
regdump->lastError = lastError;
return true;

View File

@ -111,7 +111,7 @@ bool stackcommentget(duint addr, STACK_COMMENT* comment)
char string[MAX_STRING_SIZE] = "";
if(DbgGetStringAt(data, string))
{
strcpy_s(comment->comment, _TRUNCATE, string);
strncpy_s(comment->comment, string, _TRUNCATE);
return true;
}

View File

@ -1301,7 +1301,7 @@ bool valapifromstring(const char* name, duint* value, int* value_size, bool prin
}
else
{
strcpy_s(modname, _TRUNCATE, name);
strncpy_s(modname, name, _TRUNCATE);
modname[apiname - name] = 0;
}
apiname++;

View File

@ -35,7 +35,7 @@ void EditBreakpointDialog::loadFromBp()
template<typename T>
void copyTruncate(T dest, const QString & src)
{
strcpy_s(dest, _TRUNCATE, src.toUtf8().constData());
strncpy_s(dest, src.toUtf8().constData(), _TRUNCATE);
}
void EditBreakpointDialog::on_editName_textEdited(const QString & arg1)