Skip to content

Commit

Permalink
Fix #21715 - Using wrong baddr in apk:// when multiopening ##io
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed May 31, 2023
1 parent 8876cb9 commit cf0f03a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libr/core/cfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ R_API RIODesc *r_core_file_open_many(RCore *r, const char *file, int perm, ut64
}
RListIter *iter;
RIODesc *first = NULL;
bool incloadaddr = loadaddr == 0;
bool incloadaddr = loadaddr == UT64_MAX;
// r_config_set_b (r->config, "io.va", false);
r_list_foreach (list_fds, iter, fd) {
if (fd->uri) {
Expand All @@ -866,6 +866,9 @@ R_API RIODesc *r_core_file_open_many(RCore *r, const char *file, int perm, ut64
if (incloadaddr && sz != UT64_MAX) {
const int rest = (sz % 4096);
const int pillow = 0x4000;
if (loadaddr == UT64_MAX) {
loadaddr = 0;
}
loadaddr += sz + rest + pillow;
}
}
Expand Down

0 comments on commit cf0f03a

Please sign in to comment.