mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-24 13:49:50 +00:00
Fix assert in RSign.loadGZ() when file not found in path
This commit is contained in:
parent
d1e1ef6159
commit
727bc9cd2c
@ -2941,6 +2941,10 @@ R_API bool r_sign_load_gz(RAnal *a, const char *filename, bool merge) {
|
||||
char *tmpfile = NULL;
|
||||
bool retval = true;
|
||||
char *path = r_sign_path (a, filename);
|
||||
if (!path) {
|
||||
R_LOG_ERROR ("file %s not found in sign path", filename);
|
||||
return false;
|
||||
}
|
||||
if (!r_file_exists (path)) {
|
||||
R_LOG_ERROR ("file %s does not exist", filename);
|
||||
retval = false;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* radare - LGPL - Copyright 2007-2022 - pancake */
|
||||
/* radare - LGPL - Copyright 2007-2023 - pancake */
|
||||
|
||||
#define R_LOG_ORIGIN "filter"
|
||||
|
||||
@ -181,6 +181,7 @@ R_API bool r_file_is_directory(const char *str) {
|
||||
}
|
||||
|
||||
R_API bool r_file_fexists(const char *fmt, ...) {
|
||||
r_return_val_if_fail (fmt, false);
|
||||
int ret;
|
||||
char string[BS];
|
||||
va_list ap;
|
||||
@ -192,6 +193,7 @@ R_API bool r_file_fexists(const char *fmt, ...) {
|
||||
}
|
||||
|
||||
R_API bool r_file_exists(const char *str) {
|
||||
r_return_val_if_fail (str, false);
|
||||
struct stat buf = {0};
|
||||
#if 1
|
||||
if (file_stat (str, &buf) != 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user