diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -1996,8 +1996,7 @@ INTERCEPTOR(__sanitizer_passwd *, getpwnam, const char *name) { void *ctx; COMMON_INTERCEPTOR_ENTER(ctx, getpwnam, name); - if (name) - COMMON_INTERCEPTOR_READ_RANGE(ctx, name, internal_strlen(name) + 1); + COMMON_INTERCEPTOR_READ_RANGE(ctx, name, internal_strlen(name) + 1); __sanitizer_passwd *res = REAL(getpwnam)(name); unpoison_passwd(ctx, res); return res; diff --git a/compiler-rt/test/asan/TestCases/Darwin/getpwnam.c b/compiler-rt/test/asan/TestCases/Darwin/getpwnam.c deleted file mode 100644 --- a/compiler-rt/test/asan/TestCases/Darwin/getpwnam.c +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: %clang_asan %s -o %t -// RUN: %run %t 2>&1 | FileCheck %s - -#include -#include -#include -#include - -int main(int argc, const char * argv[]) { - getpwnam(NULL); - fprintf(stderr, "Finished.\n"); - return 0; -} - -// CHECK: Finished.