mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-08-06 22:08:41 +00:00
fix big growth path in arena; make rdi parse code slightly more robust to malformed rdis
This commit is contained in:
@@ -87,7 +87,7 @@ arena_push(Arena *arena, U64 size, U64 align)
|
|||||||
{
|
{
|
||||||
U64 res_size = current->res_size;
|
U64 res_size = current->res_size;
|
||||||
U64 cmt_size = current->cmt_size;
|
U64 cmt_size = current->cmt_size;
|
||||||
if(size > res_size)
|
if(size + ARENA_HEADER_SIZE > res_size)
|
||||||
{
|
{
|
||||||
res_size = size + ARENA_HEADER_SIZE;
|
res_size = size + ARENA_HEADER_SIZE;
|
||||||
cmt_size = size + ARENA_HEADER_SIZE;
|
cmt_size = size + ARENA_HEADER_SIZE;
|
||||||
|
|||||||
@@ -98,7 +98,8 @@ rdi_section_raw_data_from_kind(RDI_Parsed *rdi, RDI_SectionKind kind, RDI_Sectio
|
|||||||
result = &rdi_nil_element_union;
|
result = &rdi_nil_element_union;
|
||||||
*size_out = rdi_section_element_size_table[kind];
|
*size_out = rdi_section_element_size_table[kind];
|
||||||
#endif
|
#endif
|
||||||
if(0 <= kind && kind < rdi->sections_count)
|
if(0 <= kind && kind < rdi->sections_count &&
|
||||||
|
rdi->sections[kind].off < rdi->raw_data_size)
|
||||||
{
|
{
|
||||||
result = rdi->raw_data+rdi->sections[kind].off;
|
result = rdi->raw_data+rdi->sections[kind].off;
|
||||||
*size_out = rdi->sections[kind].encoded_size;
|
*size_out = rdi->sections[kind].encoded_size;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ arena_push(Arena *arena, U64 size, U64 align)
|
|||||||
{
|
{
|
||||||
U64 res_size = current->res_size;
|
U64 res_size = current->res_size;
|
||||||
U64 cmt_size = current->cmt_size;
|
U64 cmt_size = current->cmt_size;
|
||||||
if(size > res_size)
|
if(size + ARENA_HEADER_SIZE > res_size)
|
||||||
{
|
{
|
||||||
res_size = size + ARENA_HEADER_SIZE;
|
res_size = size + ARENA_HEADER_SIZE;
|
||||||
cmt_size = size + ARENA_HEADER_SIZE;
|
cmt_size = size + ARENA_HEADER_SIZE;
|
||||||
|
|||||||
Reference in New Issue
Block a user