]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/coredump/stacktrace.c
Merge pull request #20303 from andir/sysconfig-example
[thirdparty/systemd.git] / src / coredump / stacktrace.c
index 102ad2e65beb51ec0f8ff402b49ecc1590fa4621..e46b324cdf77fb003f4f290a1978a2776ecb65c5 100644 (file)
@@ -153,6 +153,8 @@ static int parse_package_metadata(const char *name, JsonVariant *id_json, Elf *e
                                             program_header->p_offset,
                                             program_header->p_filesz,
                                             ELF_T_NHDR);
+                if (!data)
+                        continue;
 
                 while (note_offset < data->d_size &&
                        (note_offset = gelf_getnote(data, note_offset, &note_header, &name_offset, &desc_offset)) > 0) {
@@ -287,7 +289,7 @@ static int module_callback(Dwfl_Module *mod, void **userdata, const char *name,
                 GElf_Phdr mem, *program_header;
                 Elf_Data *data;
 
-                /* The core file stores the ELF files in the PT_LOAD segment .*/
+                /* The core file stores the ELF files in the PT_LOAD segment*/
                 program_header = gelf_getphdr(c->elf, i, &mem);
                 if (!program_header || program_header->p_type != PT_LOAD)
                         continue;