[llvm] [llvm][ELF]Add Shdr check for getBuildID (PR #126537)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 24 00:45:06 PDT 2025


================
@@ -40,7 +40,7 @@ static StringRef getInvalidNoteELF(bool WithShdr) {
   Machine:        EM_X86_64
 ProgramHeaders:
   - Type:         PT_NOTE
-    FileSize:     0xffffffffffffffff
+    FileSize:     0xffffffffffffff88
----------------
jh7370 wrote:

Not what I had in mind, since I was referring to the original non-overflow checks (i.e. `Phdr.p_offset + Phdr.p_filesz > getBufSize()` and its section header equivalent). In other words, show that if `Phdr.p_offset + Phdr.p_filesz == getBufSize() + 1`, we get the error case (arguably there should be a separate test case where `Phdr.p_offset + Phdr.p_filesz == getBufSize()`). The same applies for the section header case.

https://github.com/llvm/llvm-project/pull/126537


More information about the llvm-commits mailing list