mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
Fix null deref crash in comments
This commit is contained in:
parent
24256f239d
commit
4a49acc2f2
@ -1077,7 +1077,7 @@ void MemoryWidget::on_actionDisasAdd_comment_triggered()
|
|||||||
{
|
{
|
||||||
// Get current offset
|
// Get current offset
|
||||||
QTextCursor tc = this->disasTextEdit->textCursor();
|
QTextCursor tc = this->disasTextEdit->textCursor();
|
||||||
tc.select( QTextCursor::LineUnderCursor );
|
tc.select( QTextCursor::LineUnderCursor);
|
||||||
QString lastline = tc.selectedText();
|
QString lastline = tc.selectedText();
|
||||||
QString ele = lastline.split(" ", QString::SkipEmptyParts)[0];
|
QString ele = lastline.split(" ", QString::SkipEmptyParts)[0];
|
||||||
if (ele.contains("0x")) {
|
if (ele.contains("0x")) {
|
||||||
@ -1091,7 +1091,9 @@ void MemoryWidget::on_actionDisasAdd_comment_triggered()
|
|||||||
// Rename function in r2 core
|
// Rename function in r2 core
|
||||||
this->main->core->setComment(ele, comment);
|
this->main->core->setComment(ele, comment);
|
||||||
// Seek to new renamed function
|
// Seek to new renamed function
|
||||||
this->main->seek(fcn->name);
|
if (fcn) {
|
||||||
|
this->main->seek(fcn->name);
|
||||||
|
}
|
||||||
// TODO: Refresh functions tree widget
|
// TODO: Refresh functions tree widget
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user