Skip to content

Commit

Permalink
Refix uninitialized vsize in on command
Browse files Browse the repository at this point in the history
  • Loading branch information
condret committed Dec 11, 2024
1 parent d469684 commit d18c5d3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libr/core/cmd_open.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1831,6 +1831,9 @@ static bool cmd_onn(RCore *core, const char* input) {
}

static int cmd_on(RCore *core, int argc, char *argv[]) {
if (argc < 1) {
return 0;
}
char *path = NULL;
int fd = -1;
ut64 vsize = 0, vaddr = 0ULL;
Expand Down Expand Up @@ -1880,9 +1883,7 @@ static int cmd_on(RCore *core, int argc, char *argv[]) {
}
vsize = r_io_fd_size (core->io, fd);
}
if (vsize == 0) {
R_LOG_WARN ("Map size not defined");
} else if (!r_io_map_add (core->io, fd, perm, 0ULL, vaddr, vsize)) {
if (!r_io_map_add (core->io, fd, perm, 0ULL, vaddr, vsize)) {
R_LOG_WARN ("Couldn't create map");
}
return fd;
Expand Down

0 comments on commit d18c5d3

Please sign in to comment.