From 04def874ebd11d928fca2eb954696772b8d74072 Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 23 Jan 2024 15:49:56 -0800 Subject: [PATCH] also don't assume we even have the PE exception data directory --- src/pe/pe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pe/pe.c b/src/pe/pe.c index 0aedd7e9..39447b98 100644 --- a/src/pe/pe.c +++ b/src/pe/pe.c @@ -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;