[llvm] r206190 - tools: fix heap-buffer-overrun detected via ASAN
Saleem Abdulrasool
compnerd at compnerd.org
Mon Apr 14 09:38:26 PDT 2014
Author: compnerd
Date: Mon Apr 14 11:38:25 2014
New Revision: 206190
URL: http://llvm.org/viewvc/llvm-project?rev=206190&view=rev
Log:
tools: fix heap-buffer-overrun detected via ASAN
Once the auxiliary fields relating to the filename have been inspected, any
following auxiliary fields need not be visited as they have been consumed (the
following fields comprise the filepath as a single unit).
Adjust the test to catch this even if ASAN is not enabled.
Modified:
llvm/trunk/test/tools/llvm-objdump/coff-file.test
llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
Modified: llvm/trunk/test/tools/llvm-objdump/coff-file.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-objdump/coff-file.test?rev=206190&r1=206189&r2=206190&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-objdump/coff-file.test (original)
+++ llvm/trunk/test/tools/llvm-objdump/coff-file.test Mon Apr 14 11:38:25 2014
@@ -2,4 +2,5 @@ RUN: llvm-objdump -t %p/Inputs/file.obj.
CHECK: .file
CHECK-NEXT: AUX /Users/compnerd/work/llvm/test/tools/llvm-readobj/Inputs/file.asm
+CHECK-NEXT: [{{[ 0-9]+}}]
Modified: llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp?rev=206190&r1=206189&r2=206190&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp (original)
+++ llvm/trunk/tools/llvm-objdump/llvm-objdump.cpp Mon Apr 14 11:38:25 2014
@@ -708,6 +708,9 @@ static void PrintCOFFSymbolTable(const C
StringRef Name(AF->FileName,
Symbol->NumberOfAuxSymbols * COFF::SymbolSize);
outs() << "AUX " << Name.rtrim(StringRef("\0", 1)) << '\n';
+
+ SI = SI + Symbol->NumberOfAuxSymbols;
+ break;
} else {
outs() << "AUX Unknown\n";
}
More information about the llvm-commits
mailing list