mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-03 12:12:06 +00:00
Fix DoS on macho parser spotted by scan coverity ##crash
This commit is contained in:
parent
6e4819b054
commit
d24dbb9fbb
@ -3151,6 +3151,13 @@ static void parse_relocation_info(struct MACH0_(obj_t) *bin, RSkipList *relocs,
|
||||
}
|
||||
|
||||
ut64 total_size = num * sizeof (struct relocation_info);
|
||||
if (offset > bin->size) {
|
||||
return;
|
||||
}
|
||||
if (total_size > bin->size) {
|
||||
total_size = bin->size - offset;
|
||||
num = total_size /= sizeof (struct relocation_info);
|
||||
}
|
||||
struct relocation_info *info = calloc (num, sizeof (struct relocation_info));
|
||||
if (!info) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user