mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 13:19:54 +00:00
Fix #21438 - Do not permit negative arguments to /z
This commit is contained in:
parent
b673677a81
commit
08e51ab484
@ -4866,14 +4866,21 @@ again:
|
|||||||
eprintf ("Usage: /z min max\n");
|
eprintf ("Usage: /z min max\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
const char *maxstr = NULL;
|
||||||
if ((p = strchr (input + 2, ' '))) {
|
if ((p = strchr (input + 2, ' '))) {
|
||||||
*p = 0;
|
*p = 0;
|
||||||
max = r_num_math (core->num, p + 1);
|
maxstr = r_str_trim_head_ro (p + 1);
|
||||||
|
max = r_num_math (core->num, maxstr);
|
||||||
} else {
|
} else {
|
||||||
eprintf ("Usage: /z min max\n");
|
eprintf ("Usage: /z min max\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
min = r_num_math (core->num, input + 2);
|
const char *minstr = r_str_trim_head_ro (input + 2);
|
||||||
|
if ((maxstr && *maxstr == '-') || (minstr && *minstr == '-')) {
|
||||||
|
R_LOG_ERROR ("min and max must be positive");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
min = r_num_math (core->num, minstr);
|
||||||
if (!r_search_set_string_limits (core->search, min, max)) {
|
if (!r_search_set_string_limits (core->search, min, max)) {
|
||||||
R_LOG_ERROR ("min must be lower than max");
|
R_LOG_ERROR ("min must be lower than max");
|
||||||
break;
|
break;
|
||||||
|
@ -14,6 +14,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r_core_cmd0 (r, "e scr.interactive=false");
|
||||||
// r_core_cmdf (r, "o malloc://%zu", Size);
|
// r_core_cmdf (r, "o malloc://%zu", Size);
|
||||||
// r_io_write_at (r->io, 0, Data, Size);
|
// r_io_write_at (r->io, 0, Data, Size);
|
||||||
r_core_cmd0 (r, "o /bin/ls");
|
r_core_cmd0 (r, "o /bin/ls");
|
||||||
|
Loading…
Reference in New Issue
Block a user