From 2e8f749bde844d590364a52d73ab257bc9cd6140 Mon Sep 17 00:00:00 2001 From: Wiseguy <68165316+Mr-Wiseguy@users.noreply.github.com> Date: Fri, 16 Jan 2026 20:54:43 -0500 Subject: [PATCH] Fix out of bounds access when searching for statics at the end of a section (#171) --- src/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.cpp b/src/main.cpp index b2816c0..f79580f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -794,7 +794,7 @@ int main(int argc, char** argv) { // Search for the closest function size_t closest_func_index = 0; - while (section_funcs[closest_func_index] < static_func_addr && closest_func_index < section_funcs.size()) { + while (closest_func_index < section_funcs.size() && section_funcs[closest_func_index] < static_func_addr) { closest_func_index++; }