diff --git a/libr/core/cconfig.c b/libr/core/cconfig.c index f33c3d287521a..4a2877bf622ab 100644 --- a/libr/core/cconfig.c +++ b/libr/core/cconfig.c @@ -1612,10 +1612,18 @@ static bool cb_color_getter(void *user, RConfigNode *node) { } static bool cb_reloff(void *user, void *data) { - // RCore *core = (RCore *) user; + const char options[] = "func\nflag\nmaps\ndmap\nfmap\nsect\nsymb\nlibs\nfile\n"; RConfigNode *node = (RConfigNode *) data; - if (strchr (node->value, '?')) { - r_cons_printf ("func\nflag\nmaps\ndmap\nfmap\nsect\nsymb\nlibs\nfile\n"); + if (*node->value) { + char *pos = strstr (options, node->value); + if (pos && pos[strlen (node->value)] == '\n') { + return true; + } + if (strchr (node->value, '?')) { + r_cons_printf (options); + } else { + R_LOG_ERROR ("Invalid value, try `-e asm.offset.relto=?`"); + } return false; } return true; diff --git a/test/db/cmd/cmd_pd_bugs b/test/db/cmd/cmd_pd_bugs index cfe75d0ba8cc6..8eee3276c9cce 100644 --- a/test/db/cmd/cmd_pd_bugs +++ b/test/db/cmd/cmd_pd_bugs @@ -34,7 +34,7 @@ NAME=pd+reloff+colors FILE=bins/elf/analysis/ls-alxchk CMDS=<