gh-129223: Raise KeyError in search_map_for_section() if not found (#129262)

This commit is contained in:
Victor Stinner 2025-01-25 18:19:48 +01:00 committed by GitHub
parent 7a54a653b7
commit be98fda7c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -383,6 +383,10 @@ search_map_for_section(pid_t pid, const char* secname, const char* map)
);
result = start_address + (uintptr_t)section->sh_addr - elf_load_addr;
}
else {
PyErr_Format(PyExc_KeyError,
"cannot find map for section %s", secname);
}
exit:
if (close(fd) != 0) {