readelf: avoid a possible divide by zero

* readelf.c (process_section_headers): Check SHT_RELR entsize.
This commit is contained in:
Alan Modra
2021-12-19 12:18:50 +10:30
parent 6b526f64aa
commit 682351b932

View File

@ -7093,6 +7093,10 @@ process_section_headers (Filedata * filedata)
warn (_("Section '%s': zero-sized relocation section\n"), name); warn (_("Section '%s': zero-sized relocation section\n"), name);
break; break;
case SHT_RELR:
CHECK_ENTSIZE (section, i, Relr);
break;
case SHT_NOTE: case SHT_NOTE:
case SHT_PROGBITS: case SHT_PROGBITS:
/* Having a zero sized section is not illegal according to the /* Having a zero sized section is not illegal according to the