mirror of
https://github.com/radareorg/radare2.git
synced 2024-10-07 10:33:30 +00:00
Fix oobread in load_zign ##shell
This commit is contained in:
parent
727bc9cd2c
commit
d054fd1312
@ -2913,10 +2913,12 @@ R_API char *r_sign_path(RAnal *a, const char *file) {
|
||||
}
|
||||
|
||||
R_API bool r_sign_load(RAnal *a, const char *file, bool merge) {
|
||||
if (!a || !file) {
|
||||
r_return_val_if_fail (a && file, false);
|
||||
char *path = r_sign_path (a, file);
|
||||
if (!path) {
|
||||
R_LOG_ERROR ("file %s not found in sign path", file);
|
||||
return false;
|
||||
}
|
||||
char *path = r_sign_path (a, file);
|
||||
if (!r_file_exists (path)) {
|
||||
R_LOG_ERROR ("file %s does not exist", file);
|
||||
free (path);
|
||||
|
@ -291,13 +291,13 @@ static int cmdOpen(void *data, const char *input) {
|
||||
switch (*input) {
|
||||
case ' ':
|
||||
if (input[1]) {
|
||||
return r_sign_load (core->anal, input + 1, false);
|
||||
return r_sign_load (core->anal, r_str_trim_head_ro (input + 1), false);
|
||||
}
|
||||
r_core_cmd_help_match (core, help_msg_zo, "zo", false);
|
||||
return false;
|
||||
case 's':
|
||||
if (input[1] == ' ' && input[2]) {
|
||||
return r_sign_save (core->anal, input + 2);
|
||||
return r_sign_save (core->anal, r_str_trim_head_ro (input + 2));
|
||||
}
|
||||
r_core_cmd_help_match (core, help_msg_zo, "zos", false);
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user