mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 19:06:10 +00:00
Fix potential nullptr dereference (#2028)
This commit is contained in:
parent
c7d66cec06
commit
27449af445
@ -1921,6 +1921,10 @@ void CutterCore::addBreakpoint(const BreakpointDescription &config)
|
|||||||
breakpoint = r_debug_bp_add(core->dbg, address, (config.hw && watchpoint_prot == 0),
|
breakpoint = r_debug_bp_add(core->dbg, address, (config.hw && watchpoint_prot == 0),
|
||||||
watchpoint_prot, watchpoint_prot,
|
watchpoint_prot, watchpoint_prot,
|
||||||
module, config.moduleDelta);
|
module, config.moduleDelta);
|
||||||
|
if (!breakpoint) {
|
||||||
|
QMessageBox::critical(nullptr, tr("Breakpoint error"), tr("Failed to create breakpoint"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (config.type == BreakpointDescription::Named) {
|
if (config.type == BreakpointDescription::Named) {
|
||||||
updateOwnedCharPtr(breakpoint->expr, config.positionExpression);
|
updateOwnedCharPtr(breakpoint->expr, config.positionExpression);
|
||||||
}
|
}
|
||||||
@ -1932,10 +1936,6 @@ void CutterCore::addBreakpoint(const BreakpointDescription &config)
|
|||||||
updateOwnedCharPtr(breakpoint->name, config.positionExpression);
|
updateOwnedCharPtr(breakpoint->name, config.positionExpression);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!breakpoint) {
|
|
||||||
QMessageBox::critical(nullptr, tr("Breakpoint error"), tr("Failed to create breakpoint"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int index = std::find(core->dbg->bp->bps_idx,
|
int index = std::find(core->dbg->bp->bps_idx,
|
||||||
core->dbg->bp->bps_idx + core->dbg->bp->bps_idx_count,
|
core->dbg->bp->bps_idx + core->dbg->bp->bps_idx_count,
|
||||||
breakpoint) - core->dbg->bp->bps_idx;
|
breakpoint) - core->dbg->bp->bps_idx;
|
||||||
|
Loading…
Reference in New Issue
Block a user