diff options
Diffstat (limited to 'libdwfl/linux-core-attach.c')
-rw-r--r-- | libdwfl/linux-core-attach.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libdwfl/linux-core-attach.c b/libdwfl/linux-core-attach.c index c0f1b0d0..f68062f0 100644 --- a/libdwfl/linux-core-attach.c +++ b/libdwfl/linux-core-attach.c @@ -181,7 +181,8 @@ core_set_initial_registers (Dwfl_Thread *thread, void *thread_arg_voidp) size_t getnote_err = gelf_getnote (note_data, offset, &nhdr, &name_offset, &desc_offset); /* __libdwfl_attach_state_for_core already verified the note is there. */ - assert (getnote_err != 0); + if (getnote_err == 0) + return false; /* Do not check NAME for now, help broken Linux kernels. */ const char *name = (nhdr.n_namesz == 0 ? "" : note_data->d_buf + name_offset); @@ -195,8 +196,8 @@ core_set_initial_registers (Dwfl_Thread *thread, void *thread_arg_voidp) ®s_offset, &nregloc, ®locs, &nitems, &items); /* __libdwfl_attach_state_for_core already verified the note is there. */ - assert (core_note_err != 0); - assert (nhdr.n_type == NT_PRSTATUS); + if (core_note_err == 0 || nhdr.n_type != NT_PRSTATUS) + return false; const Ebl_Core_Item *item; for (item = items; item < items + nitems; item++) if (strcmp (item->name, "pid") == 0) |