From 07e64071158857435e89fa35cd90f7e245dc6485 Mon Sep 17 00:00:00 2001 From: Yacine Elhamer Date: Sat, 22 Apr 2023 01:10:26 +0100 Subject: [PATCH] _parse(): safeguard against zero entry size --- capa/features/extractors/elf.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/capa/features/extractors/elf.py b/capa/features/extractors/elf.py index fd0087ef..9ef1ed12 100644 --- a/capa/features/extractors/elf.py +++ b/capa/features/extractors/elf.py @@ -651,6 +651,9 @@ class SymTab: return the symbol's information in the order specified by sys/elf32.h """ + if self.symtab.entsize == 0: + return + for i in range(int(len(self.symtab.buf) / self.symtab.entsize)): if bitness == 32: name_offset, value, size, info, other, shndx = struct.unpack_from(