aboutsummaryrefslogtreecommitdiff
path: root/lib/asan/output_tests/interception_failure_test-linux.cc
blob: 9e8b7536906b0537274f9e87aa0e14f7b9764f09 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdlib.h>
#include <stdio.h>

extern "C" long strtol(const char *nptr, char **endptr, int base) {
  fprintf(stderr, "my_strtol_interceptor\n");
  return 0;
}

int main() {
  char *x = (char*)malloc(10 * sizeof(char));
  free(x);
  return (int)strtol(x, 0, 10);
}

// Check-Common: my_strtol_interceptor
// CHECK-NOT: heap-use-after-free