[all-commits] [llvm/llvm-project] 762fb1: [llvm-objcopy] Avoid invalid Sec.Offset after D79229
Fangrui Song via All-commits
all-commits at lists.llvm.org
Sun May 3 21:58:39 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 762fb1c40eea6878c2d6a1f0f1fc7915c8747981
https://github.com/llvm/llvm-project/commit/762fb1c40eea6878c2d6a1f0f1fc7915c8747981
Author: Fangrui Song <maskray at google.com>
Date: 2020-05-03 (Sun, 03 May 2020)
Changed paths:
M llvm/tools/llvm-objcopy/ELF/Object.cpp
Log Message:
-----------
[llvm-objcopy] Avoid invalid Sec.Offset after D79229
To avoid undefined behavior caught by -fsanitize=undefined on binary-paddr.test
void SectionWriter::visit(const Section &Sec) {
if (Sec.Type != SHT_NOBITS)
// Sec.Contents is empty while Sec.Offset may be out of bound
llvm::copy(Sec.Contents, Out.getBufferStart() + Sec.Offset);
}
More information about the All-commits
mailing list