mirror of
https://github.com/QuasarApp/pe-parse.git
synced 2025-04-26 12:24:32 +00:00
parse: Limit resource table recursion to 3 levels (#77)
This commit is contained in:
parent
19a3bf4859
commit
697714b379
@ -359,6 +359,15 @@ bool parse_resource_table(bounded_buffer *sectionData,
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* .rsrc can accomodate up to 2**31 levels, but Windows only uses 3 by convention.
|
||||
* As such, any depth above 3 indicates potentially unchecked recusion.
|
||||
* See: https://docs.microsoft.com/en-us/windows/desktop/debug/pe-format#the-rsrc-section
|
||||
*/
|
||||
|
||||
PE_ERR(PEERR_RESC);
|
||||
return false;
|
||||
}
|
||||
|
||||
// High bit 0 = RVA to RDT.
|
||||
// High bit 1 = RVA to RDE.
|
||||
|
Loading…
x
Reference in New Issue
Block a user