[compiler-rt] r227799 - [ASan/Win] Add a test case for r208215 [stack buffer overflow in <iostream>]

Timur Iskhodzhanov timurrrr at google.com
Mon Feb 2 04:31:11 PST 2015


Author: timurrrr
Date: Mon Feb  2 06:31:11 2015
New Revision: 227799

URL: http://llvm.org/viewvc/llvm-project?rev=227799&view=rev
Log:
[ASan/Win] Add a test case for r208215 [stack buffer overflow in <iostream>]

The issue re-appears if one uses the -fsanitize-blacklist= flag,
so it's time to have a test case.

Added:
    compiler-rt/trunk/test/asan/TestCases/Windows/iostream_sbo.cc

Added: compiler-rt/trunk/test/asan/TestCases/Windows/iostream_sbo.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/iostream_sbo.cc?rev=227799&view=auto
==============================================================================
--- compiler-rt/trunk/test/asan/TestCases/Windows/iostream_sbo.cc (added)
+++ compiler-rt/trunk/test/asan/TestCases/Windows/iostream_sbo.cc Mon Feb  2 06:31:11 2015
@@ -0,0 +1,13 @@
+// RUN: %clang_cl_asan -O0 %s -Fe%t
+// RUN: echo "42" | %run %t 2>&1 | FileCheck %s
+
+#include <iostream>
+
+int main() {
+  int i;
+  std::cout << "Type i: ";
+  std::cin >> i;
+  return 0;
+// CHECK: Type i:
+// CHECK-NOT: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
+}





More information about the llvm-commits mailing list