From 821ae4ca2b4b406779528b4a87b80e1a55284ef8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 26 Jun 2026 18:17:48 +0530 Subject: [PATCH 1/6] Fix x-axis address overflow --- librz/cons/histogram.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/librz/cons/histogram.c b/librz/cons/histogram.c index c0f91f376ad..d492f5217b8 100644 --- a/librz/cons/histogram.c +++ b/librz/cons/histogram.c @@ -691,8 +691,14 @@ static void render_visual_xaxis_ruler(RzStrBuf *buf, const RzHistogramInteractiv if (!tick_cols) { return; } + ut32 space; + if ((data_cols > (ut32)addr_w)) { + space = data_cols - addr_w; + } else { + space = 1; + } for (int t = 0; t < ticks; t++) { - tick_cols[t] = (int)((ut64)t * (data_cols - 1) / (ticks - 1)); + tick_cols[t] = (int)((ut64)t * space / (ticks - 1)); } rz_strbuf_appendf(buf, "%*s", gutter_w, ""); next_tick = 0; From 01121d0b7acc0235c9216562dc2b6fb0b357cbed Mon Sep 17 00:00:00 2001 From: Farhan Saiyed Date: Tue, 14 Jul 2026 19:07:24 +0530 Subject: [PATCH 2/6] Test fix --- test/db/cmd/cmd_interactive_modes | 42 +++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/test/db/cmd/cmd_interactive_modes b/test/db/cmd/cmd_interactive_modes index 059f435406b..9ed92463507 100644 --- a/test/db/cmd/cmd_interactive_modes +++ b/test/db/cmd/cmd_interactive_modes @@ -36,12 +36,16 @@ e scr.utf8=false echo EOF EXPECT=< |  0> | +[?25l +0> |  +0> | - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces use of '!!' instead. │ !! [ ...] # Run command via system(3) and pipe its stdout to rizin [?25h -[?25l 0> |  0> | +[?25l +0> |  +0> | - | ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces use of '!!' instead. | !! [ ...] # Run command via system(3) and pipe its stdout to rizin [?25h @@ -60,7 +64,9 @@ e scr.color=0 echo EOF EXPECT=< |  0> | +[?25l +0> |  +0> | - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces use of '!!' instead. 0> f| 0> f| - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' @@ -80,7 +86,9 @@ e scr.color=0 echo EOF EXPECT=< |  0> | +[?25l +0> |  +0> | - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces use of '!!' instead. │ !! [ ...] # Run command via system(3) and pipe its stdout to rizin @@ -104,8 +112,11 @@ e scr.color=0 echo EOF EXPECT=< |  0> | - - analysis.apply.signature: bool - enables/disables auto-applying signatures to the loaded binary (see also flirt  +[?25l +0> |  +0> | + - analysis.apply.signature: bool - enables/disables auto-applying signatures to the loaded binary (see also flirt + analysis.arch: string,bind - Select the architecture to use [?25h EOF RUN @@ -122,7 +133,9 @@ e scr.color=0 echo EOF EXPECT=< |  0> | +[?25l +0> |  +0> | - ! | Usage: ! [ ...] # Run command via system(3) with raw output. ! | Grepping via '~' automatically forces use of '!!' ! | instead. @@ -164,9 +177,11 @@ EXPECT=< Date: Thu, 16 Jul 2026 18:08:40 +0530 Subject: [PATCH 3/6] Test fix --- test/db/cmd/cmd_interactive_modes | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/db/cmd/cmd_interactive_modes b/test/db/cmd/cmd_interactive_modes index 9ed92463507..dd990590674 100644 --- a/test/db/cmd/cmd_interactive_modes +++ b/test/db/cmd/cmd_interactive_modes @@ -177,8 +177,8 @@ EXPECT=< Date: Thu, 16 Jul 2026 18:17:10 +0530 Subject: [PATCH 4/6] Clang-format fix --- librz/cons/histogram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librz/cons/histogram.c b/librz/cons/histogram.c index d492f5217b8..cbae5a390b1 100644 --- a/librz/cons/histogram.c +++ b/librz/cons/histogram.c @@ -698,7 +698,7 @@ static void render_visual_xaxis_ruler(RzStrBuf *buf, const RzHistogramInteractiv space = 1; } for (int t = 0; t < ticks; t++) { - tick_cols[t] = (int)((ut64)t * space / (ticks - 1)); + tick_cols[t] = (int)((ut64)t * space / (ticks - 1)); } rz_strbuf_appendf(buf, "%*s", gutter_w, ""); next_tick = 0; From c93fb028c9a256f2b967d79507ba8ec24e82443e Mon Sep 17 00:00:00 2001 From: Your Name Date: Thu, 16 Jul 2026 20:40:00 +0530 Subject: [PATCH 5/6] Final fix --- test/db/cmd/cmd_interactive_modes | 252 ++++++++++++++---------------- 1 file changed, 118 insertions(+), 134 deletions(-) diff --git a/test/db/cmd/cmd_interactive_modes b/test/db/cmd/cmd_interactive_modes index dd990590674..7f0a019b9e3 100644 --- a/test/db/cmd/cmd_interactive_modes +++ b/test/db/cmd/cmd_interactive_modes @@ -1,94 +1,86 @@ -NAME=Internal less -FILE== -CMDS=< |  -0> | +[?25l 0> |  0> | - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces use of '!!' instead. │ !! [ ...] # Run command via system(3) and pipe its stdout to rizin [?25h -[?25l -0> |  -0> | +[?25l 0> |  0> | - | ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces use of '!!' instead. | !! [ ...] # Run command via system(3) and pipe its stdout to rizin [?25h EOF -RUN - -NAME=?** entire help string on match -FILE=-- -CMDS=< |  -0> | +[?25l 0> |  0> | - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces use of '!!' instead. 0> f| 0> f| - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically Forces use oF '!!' instead. [?25h EOF -RUN - -NAME=?** wrapping -FILE=-- -CMDS=< |  -0> | +[?25l 0> |  0> | - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces use of '!!' instead. │ !! [ ...] # Run command via system(3) and pipe its stdout to rizin @@ -98,44 +90,39 @@ EXPECT=< # Calculate length of string . Quiet mode stores value in `$?` register. (Quiet mode) [?25h EOF -RUN - -NAME=?**e search -FILE== -CMDS=< |  -0> | - - analysis.apply.signature: bool - enables/disables auto-applying signatures to the loaded binary (see also flirt - +[?25l 0> |  0> | + - analysis.apply.signature: bool - enables/disables auto-applying signatures to the loaded binary (see also flirt  analysis.arch: string,bind - Select the architecture to use [?25h EOF -RUN - -NAME=?*** search -FILE== -CMDS=< |  -0> | +[?25l 0> |  0> | - ! | Usage: ! [ ...] # Run command via system(3) with raw output. ! | Grepping via '~' automatically forces use of '!!' ! | instead. @@ -152,21 +139,21 @@ EXPECT=< # Calculate length of string . Quiet mode stores value in `$?` register. %L | (quiet mode) [?25h EOF -RUN - -NAME=p==v visual histogram interactive (#4431 regression) -FILE=malloc://512 -CMDS=< Date: Thu, 16 Jul 2026 20:49:15 +0530 Subject: [PATCH 6/6] Final fix --- test/db/cmd/cmd_interactive_modes | 170 ++++++++++++++---------------- 1 file changed, 77 insertions(+), 93 deletions(-) diff --git a/test/db/cmd/cmd_interactive_modes b/test/db/cmd/cmd_interactive_modes index accae6942a5..7f0a019b9e3 100644 --- a/test/db/cmd/cmd_interactive_modes +++ b/test/db/cmd/cmd_interactive_modes @@ -35,21 +35,17 @@ e scr.utf8=false < \n; ?** echo EOF -EXPECT=< |  -0> | - - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces - use of '!!' instead. - │ !! [ ...] # Run command via system(3) and pipe its stdout to rizin [?25h - -[?25l -0> |  -0> | - - | ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces - use of '!!' instead. - | !! [ ...] # Run command via system(3) and pipe its stdout to rizin [?25h -EOF +EXPECT=< |  0> | + - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces + use of '!!' instead. + │ !! [ ...] # Run command via system(3) and pipe its stdout to rizin [?25h + +[?25l 0> |  0> | + - | ! [ ...] # Run command via system(3) with raw output. Grepping via '~' automatically forces + use of '!!' instead. + | !! [ ...] # Run command via system(3) and pipe its stdout to rizin [?25h +EOF RUN NAME=?** entire help string on match @@ -63,15 +59,13 @@ e scr.color=0 < f\n; ?** echo EOF -EXPECT=< |  -0> | - - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' - automatically forces use of '!!' instead. 0> f| 0> f| - - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' - automatically Forces use oF '!!' instead. [?25h -EOF +EXPECT=< |  0> | + - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' + automatically forces use of '!!' instead. 0> f| 0> f| + - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' + automatically Forces use oF '!!' instead. [?25h +EOF RUN NAME=?** wrapping @@ -85,19 +79,17 @@ e scr.color=0 < q\n; ?** echo EOF -EXPECT=< |  -0> | - - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' - automatically forces use of '!!' instead. - │ !! [ ...] # Run command via system(3) and pipe its stdout to rizin - │ #! [ ...] # Run interpreter 0> q| 0> q| - - │ %l # Calculate length of string . Quiet mode stores value in `$?` - register. - │ %lQ # Calculate length of string . Quiet mode stores value in `$?` - register. (Quiet mode) [?25h -EOF +EXPECT=< |  0> | + - │ ! [ ...] # Run command via system(3) with raw output. Grepping via '~' + automatically forces use of '!!' instead. + │ !! [ ...] # Run command via system(3) and pipe its stdout to rizin + │ #! [ ...] # Run interpreter 0> q| 0> q| + - │ %l # Calculate length of string . Quiet mode stores value in `$?` + register. + │ %lQ # Calculate length of string . Quiet mode stores value in `$?` + register. (Quiet mode) [?25h +EOF RUN NAME=?**e search @@ -111,14 +103,11 @@ e scr.color=0 < \n; ?**e echo EOF -EXPECT=< |  -0> | - - analysis.apply.signature: bool - enables/disables auto-applying signatures to the loaded binary (see also flirt - - analysis.arch: string,bind - Select the architecture to use [?25h -EOF +EXPECT=< |  0> | + - analysis.apply.signature: bool - enables/disables auto-applying signatures to the loaded binary (see also flirt  + analysis.arch: string,bind - Select the architecture to use [?25h +EOF RUN NAME=?*** search @@ -132,26 +121,24 @@ e scr.color=0 < %l\n; ?*** echo EOF -EXPECT=< |  -0> | - - ! | Usage: ! [ ...] # Run command via system(3) with raw output. - ! | Grepping via '~' automatically forces use of '!!' - ! | instead. - ! | Examples: - ! | | !ls # Execute the 'ls' command via system(3) 0> %| 0> %| - - $ | Usage: $[alias[=cmd] [args...]] # List all defined aliases / Define alias (see %$? for help - % | Usage: %[j] # Evaluate numerical expression - % | │ % # Evaluate numerical expression - % | │ %j # Evaluate numerical expression (JSON mode) - %j | Usage: %j[j] # Evaluate numerical expression (JSON mode) 0> %l| 0> %l| - - %L | Usage: %L[q] # Calculate length of string . Quiet mode stores value in `$?` - %L | register. - %L | │ %L # Calculate length of string . Quiet mode stores value in `$?` register. - %L | │ %Lq # Calculate length of string . Quiet mode stores value in `$?` register. - %L | (quiet mode) [?25h -EOF +EXPECT=< |  0> | + - ! | Usage: ! [ ...] # Run command via system(3) with raw output. + ! | Grepping via '~' automatically forces use of '!!' + ! | instead. + ! | Examples: + ! | | !ls # Execute the 'ls' command via system(3) 0> %| 0> %| + - $ | Usage: $[alias[=cmd] [args...]] # List all defined aliases / Define alias (see %$? for help + % | Usage: %[j] # Evaluate numerical expression + % | │ % # Evaluate numerical expression + % | │ %j # Evaluate numerical expression (JSON mode) + %j | Usage: %j[j] # Evaluate numerical expression (JSON mode) 0> %l| 0> %l| + - %L | Usage: %L[q] # Calculate length of string . Quiet mode stores value in `$?` + %L | register. + %L | │ %L # Calculate length of string . Quiet mode stores value in `$?` register. + %L | │ %Lq # Calculate length of string . Quiet mode stores value in `$?` register. + %L | (quiet mode) [?25h +EOF RUN NAME=p==v visual histogram interactive (#4431 regression) @@ -167,32 +154,29 @@ wx 00112233445566778899aabbccddeeff @ 0 < lq; p==v echo END EOF -EXPECT=<