summaryrefslogtreecommitdiff
path: root/test/asan/TestCases/Linux/bzero_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/Linux/bzero_test.cc')
-rw-r--r--test/asan/TestCases/Linux/bzero_test.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/asan/TestCases/Linux/bzero_test.cc b/test/asan/TestCases/Linux/bzero_test.cc
new file mode 100644
index 000000000..8149ad97a
--- /dev/null
+++ b/test/asan/TestCases/Linux/bzero_test.cc
@@ -0,0 +1,13 @@
+// RUN: %clangxx_asan %s -o %t
+// RUN: not %run %t 2>&1 | FileCheck %s --check-prefix=A1
+// RUN: %env_asan_opts=replace_intrin=0 %run %t
+
+#include <strings.h>
+int main(int argc, char **argv) {
+ char a1[] = {1, 2, 3, 4, 5, 6, 7, 8};
+ bzero(a1, sizeof(a1) + 1); // BOOM
+ // A1: AddressSanitizer: stack-buffer-overflow
+ // A1: {{#0.*memset}}
+ // A1: 'a1' <== Memory access at offset
+ return 0;
+}