From 682351b932ba546b4451560917e819681c808f52 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Sun, 19 Dec 2021 12:18:50 +1030 Subject: [PATCH] readelf: avoid a possible divide by zero * readelf.c (process_section_headers): Check SHT_RELR entsize. --- binutils/readelf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/binutils/readelf.c b/binutils/readelf.c index 2225b7d9046..990b7597dd3 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -7093,6 +7093,10 @@ process_section_headers (Filedata * filedata) warn (_("Section '%s': zero-sized relocation section\n"), name); break; + case SHT_RELR: + CHECK_ENTSIZE (section, i, Relr); + break; + case SHT_NOTE: case SHT_PROGBITS: /* Having a zero sized section is not illegal according to the -- 2.30.2