In process_file we allocate a bitmap sections to track which sections
we want to (de)compress. This allocates shnum / 8 + 1 unsigned
ints. But an unsigned int can contain more bits than just 8. In all
other places we use WORD_BITS defined as 8U * sizeof (unsigned int).
Also use WORD_BITS to calculate how many unsigned ints we need for the
sections bitmap.
* src/elfcompress.c (process_file): Use shnum / WORD_BITS + 1
to allocate sections.
Signed-off-by: Mark Wielaard <mark@klomp.org>
goto cleanup;
}
- sections = xcalloc (shnum / 8 + 1, sizeof (unsigned int));
+ sections = xcalloc (shnum / WORD_BITS + 1, sizeof (unsigned int));
size_t phnum;
if (elf_getphdrnum (elf, &phnum) != 0)