Files
clang-p2996/compiler-rt/test/asan/TestCases/Darwin/fclose.c
Kuba Mracek e73d1f13b6 [asan] Don't crash on fclose(NULL)
It's explicitly forbidden to call fclose with NULL, but at least on Darwin, this succeeds and doesn't segfault. To maintain binary compatibility, ASan should survice fclose(NULL) as well.

Differential Revision: https://reviews.llvm.org/D40053

llvm-svn: 319347
2017-11-29 19:43:11 +00:00

14 lines
233 B
C

// RUN: %clang_asan %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s
#include <stdio.h>
#include <stdlib.h>
int main(int argc, const char * argv[]) {
fclose(NULL);
fprintf(stderr, "Finished.\n");
return 0;
}
// CHECK: Finished.