Fix null-deref in disassembler

This commit is contained in:
pancake 2017-04-28 12:47:55 +02:00
parent 8c8ca6b9a4
commit a0e5cd2d34

View File

@ -1590,7 +1590,11 @@ void MemoryWidget::on_disasTextEdit_2_cursorPositionChanged()
QTextCursor tc = this->disasTextEdit->textCursor();
tc.select(QTextCursor::LineUnderCursor);
QString lastline = tc.selectedText().trimmed();
QString ele = lastline.split(" ", QString::SkipEmptyParts)[0];
QList<QString> words = lastline.split(" ", QString::SkipEmptyParts);
if (words.length() == 0) {
return;
}
QString ele = words[0];
if (ele.contains("0x"))
{
this->fillOffsetInfo(ele);