[compiler-rt] [compiler-rt][msan] Ignore addrinfo padding in getaddrinfo interceptor (PR #219124)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 1 21:51:21 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,inc -- compiler-rt/test/msan/getaddrinfo-padding.cpp compiler-rt/test/sanitizer_common/TestCases/getaddrinfo.cpp compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc compiler-rt/test/msan/getaddrinfo-positive.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
index 3f31a4ef5..fa094730e 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
@@ -2984,16 +2984,14 @@ INTERCEPTOR(int, getaddrinfo, char *node, char *service,
sizeof(hints->ai_protocol));
COMMON_INTERCEPTOR_READ_RANGE(ctx, &hints->ai_addrlen,
sizeof(hints->ai_addrlen));
- COMMON_INTERCEPTOR_READ_RANGE(ctx, &hints->ai_addr,
- sizeof(hints->ai_addr));
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, &hints->ai_addr, sizeof(hints->ai_addr));
COMMON_INTERCEPTOR_READ_RANGE(ctx, &hints->ai_canonname,
sizeof(hints->ai_canonname));
- COMMON_INTERCEPTOR_READ_RANGE(ctx, &hints->ai_next,
- sizeof(hints->ai_next));
-#if SANITIZER_AIX
+ COMMON_INTERCEPTOR_READ_RANGE(ctx, &hints->ai_next, sizeof(hints->ai_next));
+# if SANITIZER_AIX
COMMON_INTERCEPTOR_READ_RANGE(ctx, &hints->ai_eflags,
sizeof(hints->ai_eflags));
-#endif
+# endif
}
// FIXME: under ASan the call below may write to freed memory and corrupt
// its metadata. See
``````````
</details>
https://github.com/llvm/llvm-project/pull/219124
More information about the llvm-commits
mailing list