diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc index 52178f9621bb..10c112ae98e4 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc @@ -685,7 +685,7 @@ uptr ReadBinaryName(/*out*/char *buf, uptr buf_len) { uptr module_name_len = internal_readlink( "/proc/self/exe", buf, buf_len); int readlink_error; - if (internal_iserror(buf_len, &readlink_error)) { + if (internal_iserror(module_name_len, &readlink_error)) { if (proc_self_exe_cache_len) { // If available, use the cached module name. CHECK_LE(proc_self_exe_cache_len, buf_len);