1
0
Fork 0

DBG: truncate copy data in DISASM_INSTR

closes #2028
This commit is contained in:
Duncan Ogilvie 2019-08-18 14:39:20 +02:00
parent d6b27324f4
commit 2c37afcc9e
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
1 changed files with 3 additions and 3 deletions

View File

@ -324,10 +324,10 @@ bool trydisasm(const unsigned char* buffer, duint addr, DISASM_INSTR* instr, dui
instr->type = instr_normal;
instr->arg[0].type = arg_normal;
instr->arg[0].value = decodesimpledata(buffer, type);
strcpy_s(instr->arg[0].mnemonic, GetDataTypeString((void*)buffer, size, type).c_str());
strncpy_s(instr->arg[0].mnemonic, GetDataTypeString((void*)buffer, size, type).c_str(), _TRUNCATE);
instr->instr_size = int(size);
String str = GetDataInstString((void*)buffer, MAX_DISASM_BUFFER, type);
strcpy_s(instr->instruction, str.c_str());
strncpy_s(instr->instruction, str.c_str(), _TRUNCATE);
return true;
}
@ -341,7 +341,7 @@ bool trydisasmfast(const unsigned char* data, duint addr, BASIC_INSTRUCTION_INFO
basicinfo->type = TYPE_VALUE;
basicinfo->size = int(size);
String str = GetDataInstString((void*)data, MAX_DISASM_BUFFER, type);
strcpy_s(basicinfo->instruction, str.c_str());
strncpy_s(basicinfo->instruction, str.c_str(), _TRUNCATE);
basicinfo->value.size = VALUE_SIZE(size);
basicinfo->value.value = decodesimpledata(data, type);
return true;