Fix out of bounds access when searching for statics at the end of a section (#171)

This commit is contained in:
Wiseguy 2026-01-16 20:54:43 -05:00 committed by GitHub
parent 2b6f05688d
commit 2e8f749bde
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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++;
}