1
0
Fork 0

GUI: possible fix for an irreproducible crash

This commit is contained in:
mrexodia 2016-08-28 18:36:18 +02:00
parent 7c83379d6f
commit 8f3d12dafe
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
1 changed files with 4 additions and 6 deletions

View File

@ -279,12 +279,10 @@ void* Bridge::processMessage(GUIMSG type, void* param1, void* param2)
return 0; return 0;
QBeaEngine disasm(int(ConfigUint("Disassembler", "MaxModuleSize"))); QBeaEngine disasm(int(ConfigUint("Disassembler", "MaxModuleSize")));
Instruction_t instr = disasm.DisassembleAt(wBuffer, 16, 0, parVA); Instruction_t instr = disasm.DisassembleAt(wBuffer, 16, 0, parVA);
RichTextPainter::List richText; QString finalInstruction;
CapstoneTokenizer::TokenToRichText(instr.tokens, richText, 0); for(const auto & curToken : instr.tokens.tokens)
QString finalInstruction = ""; finalInstruction += curToken.text;
for(const auto & curRichText : richText) strncpy_s(text, GUI_MAX_DISASSEMBLY_SIZE, finalInstruction.toUtf8().constData(), _TRUNCATE);
finalInstruction += curRichText.text;
strcpy_s(text, GUI_MAX_DISASSEMBLY_SIZE, finalInstruction.toUtf8().constData());
return (void*)1; return (void*)1;
} }
break; break;