X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Flttng-elf.cpp;h=47d66936f9b9356c772da348f71ef849850e5dd9;hb=c9e313bc594f40a86eed237dce222c0fc99c957f;hp=992410a883d8d4ffa96636f2db612c3f818e9716;hpb=a6bc4ca9d659caf016ef932fcd944029737ac57c;p=lttng-tools.git diff --git a/src/common/lttng-elf.cpp b/src/common/lttng-elf.cpp index 992410a88..47d66936f 100644 --- a/src/common/lttng-elf.cpp +++ b/src/common/lttng-elf.cpp @@ -8,11 +8,11 @@ */ #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -824,6 +824,12 @@ int lttng_elf_get_symbol_offset(int fd, char *symbol, uint64_t *offset) } /* Get the number of symbol in the table for the iteration. */ + if (symtab_hdr.sh_entsize == 0) { + DBG("Invalid ELF string table entry size."); + ret = LTTNG_ERR_ELF_PARSING; + goto free_string_table_data; + } + sym_count = symtab_hdr.sh_size / symtab_hdr.sh_entsize; /* Loop over all symbol. */