<div dir="ltr">On second thought, we should never use report_fatal_error in libObject to report corrupted input, because it enforces a specific error handling policy rather than defer it to an application. Could you return an error instead?</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 20, 2016 at 1:12 AM, George Rimar <span dir="ltr"><<a href="mailto:grimar@accesssoftek.com" target="_blank">grimar@accesssoftek.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This revision was automatically updated to reflect the committed changes.<br>
Closed by commit rL284702: [Object/ELF] - Check index argument in getSymbol(). (authored by grimar).<br>
<br>
Changed prior to commit:<br>
  <a href="https://reviews.llvm.org/D25516?vs=74383&id=75271#toc" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D25516?vs=74383&id=75271#toc</a><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D25516" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D25516</a><br>
<br>
Files:<br>
  llvm/trunk/include/llvm/<wbr>Object/ELF.h<br>
<br>
<br>
Index: llvm/trunk/include/llvm/<wbr>Object/ELF.h<br>
==============================<wbr>==============================<wbr>=======<br>
--- llvm/trunk/include/llvm/<wbr>Object/ELF.h<br>
+++ llvm/trunk/include/llvm/<wbr>Object/ELF.h<br>
<span class="">@@ -168,7 +168,10 @@<br>
   ErrorOr<const Elf_Shdr *> getSection(uint32_t Index) const;<br>
<br>
   const Elf_Sym *getSymbol(const Elf_Shdr *Sec, uint32_t Index) const {<br>
-    return &symbols(Sec)[Index];<br>
+    Elf_Sym_Range Symbols = symbols(Sec);<br>
</span>+    if (Index >= Symbols.size())<br>
<div class="HOEnZb"><div class="h5">+      report_fatal_error("Invalid symbol index");<br>
+    return &Symbols[Index];<br>
   }<br>
<br>
   ErrorOr<StringRef> getSectionName(const Elf_Shdr *Section) const;<br>
<br>
<br>
</div></div></blockquote></div><br></div>