summaryrefslogtreecommitdiff
path: root/lib/asan/output_tests/strncpy-overflow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/asan/output_tests/strncpy-overflow.cc')
-rw-r--r--lib/asan/output_tests/strncpy-overflow.cc24
1 files changed, 0 insertions, 24 deletions
diff --git a/lib/asan/output_tests/strncpy-overflow.cc b/lib/asan/output_tests/strncpy-overflow.cc
deleted file mode 100644
index 66d5810b7040..000000000000
--- a/lib/asan/output_tests/strncpy-overflow.cc
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <string.h>
-#include <stdlib.h>
-int main(int argc, char **argv) {
- char *hello = (char*)malloc(6);
- strcpy(hello, "hello");
- char *short_buffer = (char*)malloc(9);
- strncpy(short_buffer, hello, 10); // BOOM
- return short_buffer[8];
-}
-
-// Check-Common: {{WRITE of size 1 at 0x.* thread T0}}
-// Check-Linux: {{ #0 0x.* in .*strncpy}}
-// Check-Darwin: {{ #0 0x.* in wrap_strncpy}}
-// Check-Common: {{ #1 0x.* in main .*strncpy-overflow.cc:7}}
-// Check-Common: {{0x.* is located 0 bytes to the right of 9-byte region}}
-// Check-Common: {{allocated by thread T0 here:}}
-
-// Check-Linux: {{ #0 0x.* in .*malloc}}
-// Check-Linux: {{ #1 0x.* in main .*strncpy-overflow.cc:6}}
-
-// Check-Darwin: {{ #0 0x.* in .*mz_malloc.*}}
-// Check-Darwin: {{ #1 0x.* in malloc_zone_malloc.*}}
-// Check-Darwin: {{ #2 0x.* in malloc.*}}
-// Check-Darwin: {{ #3 0x.* in main .*strncpy-overflow.cc:6}}