Commit ce5de93e authored by Fangrui Song's avatar Fangrui Song
Browse files

[ELF] Disallow out-of-range section group indices after D70146

Exposed by invalid/sht-group-wrong-section.test
http://45.33.8.238/win/2613/step_9.txt
parent 1d943ae4
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -621,6 +621,8 @@ void ObjFile<ELFT>::initializeSections(bool ignoreComdats) {
    InputSectionBase *head;
    InputSectionBase *prev = nullptr;
    for (uint32_t secIndex : entries.slice(1)) {
      if (secIndex >= this->sections.size())
        continue;
      InputSectionBase *s = this->sections[secIndex];
      if (!s || s == &InputSection::discarded)
        continue;