From 94b1888073c342d128a591ebd1b39f8b7860f4cd Mon Sep 17 00:00:00 2001 From: Ryan Fleury Date: Tue, 23 Jan 2024 15:45:21 -0800 Subject: [PATCH] dont assume in-bounds intel pdata ranges --- 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 1e539c60..0aedd7e9 100644 --- a/src/pe/pe.c +++ b/src/pe/pe.c @@ -244,7 +244,7 @@ pe_intel_pdata_off_from_voff__binary_search(String8 data, PE_BinInfo *bin, U64 v U64 pdata_count = (range.max - range.min)/sizeof(PE_IntelPdata); // check if this bin includes a pdata array - if(pdata_count > 0) + if(pdata_count > 0 && 0 <= pdata_off && pdata_off < data.size) { PE_IntelPdata *pdata_array = (PE_IntelPdata*)(data.str + pdata_off); if(voff >= pdata_array[0].voff_first)