Skip to content

Commit

Permalink
also don't assume we even have the PE exception data directory
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanfleury committed Jan 23, 2024
1 parent 94b1888 commit 04def87
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pe/pe.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ internal U64
pe_intel_pdata_off_from_voff__binary_search(String8 data, PE_BinInfo *bin, U64 voff)
{
U64 result = 0;
if(bin->arch != Architecture_Null)
if(bin->arch != Architecture_Null && PE_DataDirectoryIndex_EXCEPTIONS < bin->data_dir_count)
{
Rng1U64 range = bin->data_dir_franges[PE_DataDirectoryIndex_EXCEPTIONS];
U64 pdata_off = range.min;
Expand Down

0 comments on commit 04def87

Please sign in to comment.