From 5225ba580a1460928b61d83c70795e9e4311f67a Mon Sep 17 00:00:00 2001 From: pancake Date: Fri, 3 May 2024 11:30:29 +0200 Subject: [PATCH] Fix segfault in 'drf' command ##debug --- libr/debug/dreg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libr/debug/dreg.c b/libr/debug/dreg.c index 554177a0668a6..9e2b71c1440ae 100644 --- a/libr/debug/dreg.c +++ b/libr/debug/dreg.c @@ -1,4 +1,4 @@ -/* radare - LGPL - Copyright 2009-2023 - pancake */ +/* radare - LGPL - Copyright 2009-2024 - pancake */ #include #include // just to get the RPrint instance @@ -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