1 // Test strict_string_checks option in strchr function
2 // RUN: %clang_asan %s -o %t && %run %t 2>&1
3 // RUN: %env_asan_opts=strict_string_checks=false %run %t 2>&1
4 // RUN: %env_asan_opts=strict_string_checks=true not %run %t 2>&1 | FileCheck %s
10 int main(int argc
, char **argv
) {
13 char *s
= (char*)malloc(size
);
14 memset(s
, fill
, size
);
16 char* r
= strchr(s
, c
);
17 // CHECK: {{.*ERROR: AddressSanitizer: heap-buffer-overflow on address}}
18 // CHECK: READ of size 101