xref: /llvm-project/compiler-rt/test/asan/TestCases/Posix/wcrtomb.c (revision 19cad6f08967d06c9145ab151065ce9496af5295)
1 // Function not intercepted on android.
2 // UNSUPPORTED: android
3 
4 // RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
5 
6 #include <stdlib.h>
7 #include <wchar.h>
8 
main()9 int main() {
10   char *buff = (char*) malloc(MB_CUR_MAX);
11   free(buff);
12   wcrtomb(buff, L'a', NULL);
13   // CHECK: use-after-free
14   // CHECK: SUMMARY
15   return 0;
16 }
17