Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/runtime/runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ bool appimage_get_elf_section_offset_and_length(const char* fname, const char* s
data = mmap(NULL, map_size, PROT_READ, MAP_SHARED, fd, 0);
close(fd);

if (data == MAP_FAILED) {
fprintf(stderr, "Failed to mmap file %s: %s\n", fname, strerror(errno));
return false;
}

// this trick works as both 32 and 64 bit ELF files start with the e_ident[EI_NINDENT] section
unsigned char class = data[EI_CLASS];

Expand Down