summaryrefslogtreecommitdiffstats
path: root/lib/asan/tests/global-overflow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/asan/tests/global-overflow.cc')
-rw-r--r--lib/asan/tests/global-overflow.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/asan/tests/global-overflow.cc b/lib/asan/tests/global-overflow.cc
new file mode 100644
index 0000000..b85c4d2
--- /dev/null
+++ b/lib/asan/tests/global-overflow.cc
@@ -0,0 +1,12 @@
+#include <string.h>
+int main(int argc, char **argv) {
+ static char XXX[10];
+ static char YYY[10];
+ static char ZZZ[10];
+ memset(XXX, 0, 10);
+ memset(YYY, 0, 10);
+ memset(ZZZ, 0, 10);
+ int res = YYY[argc * 10]; // BOOOM
+ res += XXX[argc] + ZZZ[argc];
+ return res;
+}
OpenPOWER on IntegriCloud