Fix crash in rabin2 -g (thanks @condret)
This commit is contained in:
parent
8449eafe3d
commit
b53eb9222d
|
@ -152,6 +152,10 @@ static int extract_binobj (const RBinFile *bf, const RBinObject *o, int idx ) {
|
|||
snprintf (outfile, outfile_sz, "%s/%s.%s_%i.%d",
|
||||
outpath, ptr, arch, bits, idx);
|
||||
|
||||
if (boffset > r_buf_size (bf->buf)) {
|
||||
eprintf ("Invalid offsets\n");
|
||||
res = R_FALSE;
|
||||
} else {
|
||||
if (!outfile || !r_file_dump (outfile, bytes+boffset, bin_size)) {
|
||||
eprintf ("Error extracting %s\n", outfile);
|
||||
res = R_FALSE;
|
||||
|
@ -159,6 +163,7 @@ static int extract_binobj (const RBinFile *bf, const RBinObject *o, int idx ) {
|
|||
printf ("%s created (%"PFMT64d")\n", outfile, bin_size);
|
||||
res = R_TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
free (outfile);
|
||||
free (outpath);
|
||||
|
|
Loading…
Reference in New Issue