Fix the u64 and u32 variable length array bounds. We state they are
[n], but there is actually room for [n+1] symbols. We don't actually
use the [n+1] entry, but we the undefined sanitizer warns about this.
Found by a new testcase by Kane Wang <wangqiang1@kylinos.cn>
* libelf/elf_getarsym.c (elf_getarsym): Mark (*u64) and (*u32)
as [n+1] arrays.
Signed-off-by: Mark Wielaard <mark@klomp.org>
/* Now we can build the data structure. */
Elf_Arsym *arsym = elf->state.ar.ar_sym;
- uint64_t (*u64)[n] = file_data;
- uint32_t (*u32)[n] = file_data;
+ uint64_t (*u64)[n+1] = file_data;
+ uint32_t (*u32)[n+1] = file_data;
for (size_t cnt = 0; cnt < n; ++cnt)
{
arsym[cnt].as_name = str_data;