]> git.ipfire.org Git - thirdparty/elfutils.git/commit
elfcompress: Fix off-by-one sanity check
authorMark Wielaard <mark@klomp.org>
Mon, 18 May 2026 18:14:44 +0000 (20:14 +0200)
committerMark Wielaard <mark@klomp.org>
Thu, 21 May 2026 16:48:26 +0000 (18:48 +0200)
commitee195c3516aa64a9df1d2f096b1f56bb3fb1a7d9
tree81f9ab228195fe04c61a7aa6fdca8c039b5c7f3f
parent59b47e80cc60a5a5aede4b7d468de00490700fa5
elfcompress: Fix off-by-one sanity check

The elf ndx should not be bigger than, or equal to shnum. This really
should never trigger unless elf_ndx and/or elf_getshdrnum is buggy.

* src/elfcompress.c (process_file): Check ndx >= shnum.

Signed-off-by: Mark Wielaard <mark@klomp.org>
src/elfcompress.c