mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-24 05:40:10 +00:00
Fix oobread in the xcoff64 parser ##crash
This commit is contained in:
parent
90dc5c64f7
commit
3456d0d16e
@ -321,3 +321,4 @@ Watch until the end!
|
||||
Don't forget to subscribe!
|
||||
Ah shit, here we go again.
|
||||
Checking whether this software can be played...
|
||||
Will it blend?
|
||||
|
@ -88,6 +88,8 @@ static bool r_bin_xcoff64_init_scn_hdr(RBinXCoff64Obj *obj) {
|
||||
ut64 offset = sizeof (struct xcoff64_hdr) + obj->hdr.f_opthdr;
|
||||
size = obj->hdr.f_nscns * sizeof (struct xcoff64_scn_hdr);
|
||||
if (offset > obj->size || offset + size > obj->size || size < 0) {
|
||||
obj->hdr.f_nscns = 0;
|
||||
obj->scn_hdrs = NULL;
|
||||
return false;
|
||||
}
|
||||
obj->scn_hdrs = calloc (1, size + sizeof (struct xcoff64_scn_hdr));
|
||||
|
Loading…
Reference in New Issue
Block a user