projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1d943ae
)
[ELF] Disallow out-of-range section group indices after D70146
author
Fangrui Song
<i@maskray.me>
Tue, 19 Nov 2019 17:47:17 +0000
(09:47 -0800)
committer
Fangrui Song
<i@maskray.me>
Tue, 19 Nov 2019 17:49:45 +0000
(09:49 -0800)
Exposed by invalid/sht-group-wrong-section.test
http://45.33.8.238/win/2613/step_9.txt
lld/ELF/InputFiles.cpp
patch
|
blob
|
history
diff --git
a/lld/ELF/InputFiles.cpp
b/lld/ELF/InputFiles.cpp
index 0026aeef58dbac3867d86810fdde11d7be2ef82a..7dc72361abd75b35d48e8bd37b8bc78d9eff4a0d 100644
(file)
--- a/
lld/ELF/InputFiles.cpp
+++ b/
lld/ELF/InputFiles.cpp
@@
-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;