summaryrefslogtreecommitdiff
path: root/test/asan/TestCases/Posix/wcrtomb.c
blob: bd9a8bf3e41bd07c8f98bc139358747cd80f6be0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Function not intercepted on android.
// UNSUPPORTED: android

// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s

#include <stdlib.h>
#include <wchar.h>

int main() {
  char *buff = (char*) malloc(MB_CUR_MAX);
  free(buff);
  wcrtomb(buff, L'a', NULL);
  // CHECK: use-after-free
  // CHECK: SUMMARY
  return 0;
}