]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
getdelim: Avoid the symbol __getdelim with ASAN (regr. 2025-10-13).
authorCollin Funk <collin.funk1@gmail.com>
Wed, 15 Oct 2025 01:30:47 +0000 (18:30 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Wed, 15 Oct 2025 01:31:45 +0000 (18:31 -0700)
* lib/stdio.in.h (rpl_getdelim)
[__GLIBC__ >= 2 && !__ADDRESS_SANITIZER__]: Don't define to __getdelim
so that ___interceptor_getdelim doesn't override our symbol.

ChangeLog
lib/stdio.in.h

index c3dd9cbb7fc52dec326a285bd7327020f02f0558..c8af7641b257e92d8898b1036aaff274be5333e4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2025-10-14  Collin Funk  <collin.funk1@gmail.com>
 
+       getdelim: Avoid the symbol __getdelim with ASAN (regr. 2025-10-13).
+       * lib/stdio.in.h (rpl_getdelim)
+       [__GLIBC__ >= 2 && !__ADDRESS_SANITIZER__]: Don't define to __getdelim
+       so that ___interceptor_getdelim doesn't override our symbol.
+
        glob: Ensure --enable-cross-guesses is obeyed (regr. yesterday).
        Reported by Bruno Haible in
        <https://lists.gnu.org/archive/html/bug-gnulib/2025-10/msg00041.html>.
index 2c70bc049fccc5ab17a2647665d50de7b618698d..cc6010119d0d521f68c83e4b18fa75f079bed378 100644 (file)
@@ -1044,9 +1044,15 @@ _GL_CXXALIASWARN (getchar);
 #   undef getdelim
 #   define getdelim rpl_getdelim
 #  endif
-#  if __GLIBC__ >= 2
+#  ifndef __has_feature
+#   define __has_feature(a) 0
+#  endif
+#  if __GLIBC__ >= 2 && !(defined __SANITIZE_ADDRESS__ \
+                          || __has_feature (address_sanitizer))
 /* Arrange for the inline definition of getline() in <bits/stdio.h>
-   to call our getdelim() override.  */
+   to call our getdelim() override.  Do not use the __getdelim symbol
+   if address sanitizer is in use, otherwise it may be overridden by
+   __interceptor_trampoline___getdelim.  */
 #   define rpl_getdelim __getdelim
 #  endif
 _GL_FUNCDECL_RPL (getdelim, ssize_t,