mirror of
https://github.com/rizinorg/cutter.git
synced 2025-01-31 00:35:05 +00:00
Fix null deref (#101)
* Fix null deref when QStringList is empty * Indent memory widget
This commit is contained in:
parent
7c63a67575
commit
b7c3929d5e
@ -461,11 +461,14 @@ void MemoryWidget::refreshDisasm(QString off = "") {
|
||||
QTextCursor tc = this->disasTextEdit->textCursor();
|
||||
tc.select( QTextCursor::LineUnderCursor );
|
||||
QString lastline = tc.selectedText();
|
||||
QString ele = lastline.split(" ", QString::SkipEmptyParts)[0];
|
||||
QStringList elements = lastline.split(" ", QString::SkipEmptyParts);
|
||||
if (elements.length() > 0) {
|
||||
QString ele = elements[0];
|
||||
if (ele.contains("0x")) {
|
||||
this->main->core->cmd("s " + ele);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QString txt2 = this->main->core->cmd("pd 100");
|
||||
this->disasTextEdit->setPlainText(txt2.trimmed());
|
||||
|
Loading…
Reference in New Issue
Block a user