blob: 3998a6956f748caf002adc04947c6c0998dc2524 [file] [log] [blame]
Evgeniy Stepanovf787cf72016-12-27 22:14:03 +00001// RUN: %clang_asan -O2 %s -o %t && %run %t
2
3// FIXME: printf is not intercepted on Windows yet.
Petr Hosekeb46c952018-08-09 02:16:18 +00004// UNSUPPORTED: windows-msvc
Evgeniy Stepanovf787cf72016-12-27 22:14:03 +00005
6#include <stdio.h>
7
8int main() {
9 char s[5] = {'w', 'o', 'r', 'l', 'd'};
10 // Test that %m does not consume an argument. If it does, %s would apply to
11 // the 5-character buffer, resulting in a stack-buffer-overflow report.
12 printf("%m %s, %.5s\n", "hello", s);
13 return 0;
14}