Skip to content

Commit

Permalink
Fix last covs in rbin
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Nov 1, 2017
1 parent 93e4092 commit 7040985
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions libr/bin/format/elf/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ static Sdb *store_versioninfo_gnu_verdef(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz)
return false;
}
link_shdr = &bin->shdr[shdr->sh_link];
if (shdr->sh_size < 1 || shdr->sh_size > SIZE_MAX) {
if ((int)shdr->sh_size < 1) {
return false;
}
Elf_(Verdef) *defs = calloc (shdr->sh_size, sizeof (char));
Expand Down Expand Up @@ -837,7 +837,7 @@ static Sdb *store_versioninfo_gnu_verneed(ELFOBJ *bin, Elf_(Shdr) *shdr, int sz)
if (shdr->sh_link > bin->ehdr.e_shnum) {
return NULL;
}
if (shdr->sh_size < 1 || shdr->sh_size > SIZE_MAX) {
if ((int)shdr->sh_size < 1) {
return NULL;
}
sdb = sdb_new0 ();
Expand Down
2 changes: 1 addition & 1 deletion libr/bin/p/bin_nro.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ static bool load(RBinFile *bf) {
const ut64 sz = r_buf_size (bf->buf);
const ut64 la = bf->o->loadaddr;
const ut8 *bytes = r_buf_buffer (bf->buf);
bf->o->bin_obj = load_bytes (bf, bytes, sz, la, bf? bf->sdb: NULL);
bf->o->bin_obj = load_bytes (bf, bytes, sz, la, bf->sdb);
return bf->o->bin_obj != NULL;
}

Expand Down
10 changes: 5 additions & 5 deletions libr/bin/p/bin_sfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ static RBinInfo* info(RBinFile *bf) {
sfc_int_hdr sfchdr = {{0}};
RBinInfo *ret = NULL;
int hdroffset = 0;

#if THIS_IS_ALWAYS_FALSE_WTF
if ((bf->size & 0x8000) == 0x200) {
hdroffset = 0x200;
}

#endif
int reat = r_buf_read_at (bf->buf, 0x7FC0 + hdroffset,
(ut8*)&sfchdr, SFC_HDR_SIZE);
if (reat != SFC_HDR_SIZE) {
Expand Down Expand Up @@ -119,12 +119,12 @@ static RList* sections(RBinFile *bf) {
int hdroffset = 0;
bool is_hirom = false;
int i = 0; //0x8000-long bank number for loops

#if THIS_IS_ALWAYS_FALSE_WTF
if ((bf->size & 0x8000) == 0x200) {
hdroffset = 0x200;
}
sfc_int_hdr sfchdr;
memset (&sfchdr, 0, SFC_HDR_SIZE);
#endif
sfc_int_hdr sfchdr = {0};

int reat = r_buf_read_at (bf->buf, 0x7FC0 + hdroffset, (ut8*)&sfchdr, SFC_HDR_SIZE);
if (reat != SFC_HDR_SIZE) {
Expand Down

0 comments on commit 7040985

Please sign in to comment.