Skip to content

Commit

Permalink
Fix segfault in 'drf' command ##debug
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed May 3, 2024
1 parent 15d820f commit 5225ba5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libr/debug/dreg.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* radare - LGPL - Copyright 2009-2023 - pancake */
/* radare - LGPL - Copyright 2009-2024 - pancake */

#include <r_debug.h>
#include <r_core.h> // just to get the RPrint instance
Expand Down Expand Up @@ -31,7 +31,7 @@ R_API bool r_debug_reg_sync(RDebug *dbg, int type, int must_write) {
ut32 i = (type == R_REG_TYPE_ALL)? R_REG_TYPE_GPR: type;
// Check to get the correct arena when using @ into reg profile (arena!=type)
// if request type is positive and the request regset don't have regs
if (i >= R_REG_TYPE_GPR && dbg->reg->regset[i].regs && !dbg->reg->regset[i].regs->length) {
if (i >= R_REG_TYPE_GPR || (dbg->reg->regset[i].regs && !dbg->reg->regset[i].regs->length)) {
// seek into the other arena for redirections.
for (n = R_REG_TYPE_GPR; n < R_REG_TYPE_LAST; n++) {
// get regset mask
Expand Down

0 comments on commit 5225ba5

Please sign in to comment.