Skip to content

Commit be98fda

Browse files
authored
gh-129223: Raise KeyError in search_map_for_section() if not found (#129262)
1 parent 7a54a65 commit be98fda

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Modules/_testexternalinspection.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,10 @@ search_map_for_section(pid_t pid, const char* secname, const char* map)
383383
);
384384
result = start_address + (uintptr_t)section->sh_addr - elf_load_addr;
385385
}
386+
else {
387+
PyErr_Format(PyExc_KeyError,
388+
"cannot find map for section %s", secname);
389+
}
386390

387391
exit:
388392
if (close(fd) != 0) {

0 commit comments

Comments
 (0)