summaryrefslogtreecommitdiff
path: root/plugins/elf/section.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/elf/section.c')
-rw-r--r--plugins/elf/section.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/elf/section.c b/plugins/elf/section.c
index 556c0ed..5e42b0a 100644
--- a/plugins/elf/section.c
+++ b/plugins/elf/section.c
@@ -195,8 +195,11 @@ bool find_elf_sections_by_type(const GElfFormat *format, uint32_t type, elf_shdr
void get_elf_section_content(const GElfFormat *format, const elf_shdr *section, phys_t *offset, phys_t *size, virt_t *addr)
{
- *offset = ELF_SHDR(format, *section, sh_offset);
- *size = ELF_SHDR(format, *section, sh_size);
+ if (offset != NULL)
+ *offset = ELF_SHDR(format, *section, sh_offset);
+
+ if (size != NULL)
+ *size = ELF_SHDR(format, *section, sh_size);
if (addr != NULL)
*addr = ELF_SHDR(format, *section, sh_addr);