diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 954eaa35d4d..70e1e81a167 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2020-10-14 Tom de Vries + + PR gdb/26733 + * solib.c (solib_contains_address_p): Handle + 'solib->sections == nullptr'. + 2020-10-13 Simon Marchi PR gdb/26642 diff --git a/gdb/solib.c b/gdb/solib.c index b4864429e9a..28f6a4ecbfb 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1113,6 +1113,9 @@ bool solib_contains_address_p (const struct so_list *const solib, CORE_ADDR address) { + if (solib->sections == nullptr) + return false; + for (target_section &p : *solib->sections) if (p.addr <= address && address < p.endaddr) return true;