From: Mark Wielaard Date: Sat, 7 Sep 2024 22:00:05 +0000 (+0200) Subject: readelf: Allow .gdb_index const table to be empty X-Git-Tag: elfutils-0.192~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=90973df78628a5aefa973d676a4402285e93c9cf;p=thirdparty%2Felfutils.git readelf: Allow .gdb_index const table to be empty The .gdb_index const table can be empty, if no symbol table entry refers to a name or CU. Which technically means the symbol table is empty or has only zero members. * src/readelf.c (print_gdb_index_section): Check const_off is not past the end of the data section, it can be at the end. Signed-off-by: Mark Wielaard --- diff --git a/src/readelf.c b/src/readelf.c index 8d96443d..21cacd7b 100644 --- a/src/readelf.c +++ b/src/readelf.c @@ -11679,7 +11679,7 @@ print_gdb_index_section (Dwfl_Module *dwflmod, Ebl *ebl, } const unsigned char *const_start = data->d_buf + const_off; - if (const_off >= data->d_size) + if (const_off > data->d_size) goto invalid_data; const unsigned char *shortcut_start = NULL;