summaryrefslogtreecommitdiffstats
path: root/lib/asan/lit_tests/strncpy-overflow.cc
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2013-05-27 18:27:12 +0000
committered <ed@FreeBSD.org>2013-05-27 18:27:12 +0000
commit2f7fa77a0a85c00fd0cce298851e9577b98ccfe8 (patch)
tree50f0ab80515576749ef638dd0766b70a65904bfa /lib/asan/lit_tests/strncpy-overflow.cc
parent254a83b703ce3576b1aea35fdd5308aaf1d05f4b (diff)
downloadFreeBSD-src-2f7fa77a0a85c00fd0cce298851e9577b98ccfe8.zip
FreeBSD-src-2f7fa77a0a85c00fd0cce298851e9577b98ccfe8.tar.gz
Import compiler-rt r182741.
Diffstat (limited to 'lib/asan/lit_tests/strncpy-overflow.cc')
-rw-r--r--lib/asan/lit_tests/strncpy-overflow.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/asan/lit_tests/strncpy-overflow.cc b/lib/asan/lit_tests/strncpy-overflow.cc
index 1871184..5133b5c 100644
--- a/lib/asan/lit_tests/strncpy-overflow.cc
+++ b/lib/asan/lit_tests/strncpy-overflow.cc
@@ -22,7 +22,7 @@ int main(int argc, char **argv) {
strcpy(hello, "hello");
char *short_buffer = (char*)malloc(9);
strncpy(short_buffer, hello, 10); // BOOM
- // CHECK: {{WRITE of size 1 at 0x.* thread T0}}
+ // CHECK: {{WRITE of size 10 at 0x.* thread T0}}
// CHECK-Linux: {{ #0 0x.* in .*strncpy}}
// CHECK-Darwin: {{ #0 0x.* in _?wrap_strncpy}}
// CHECK: {{ #1 0x.* in _?main .*strncpy-overflow.cc:}}[[@LINE-4]]
@@ -32,9 +32,7 @@ int main(int argc, char **argv) {
// CHECK-Linux: {{ #0 0x.* in .*malloc}}
// CHECK-Linux: {{ #1 0x.* in main .*strncpy-overflow.cc:}}[[@LINE-10]]
- // 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:}}[[@LINE-15]]
+ // CHECK-Darwin: {{ #0 0x.* in _?wrap_malloc.*}}
+ // CHECK-Darwin: {{ #1 0x.* in _?main .*strncpy-overflow.cc:}}[[@LINE-13]]
return short_buffer[8];
}
OpenPOWER on IntegriCloud