Add workaround for memory sanitizer that cannot recognize explicit_bzero.

Otherwise it produces a lot of false positives in OSS-Fuzz.
This commit is contained in:
Milan Broz
2025-02-08 14:41:33 +01:00
parent 3899484be8
commit a2b2c6a8ae

View File

@@ -16,6 +16,13 @@
# endif # endif
#endif #endif
/* Workaround for https://github.com/google/sanitizers/issues/1507 */
#if defined __has_feature
# if __has_feature (memory_sanitizer)
# undef HAVE_EXPLICIT_BZERO
# endif
#endif
/* Memzero helper (memset on stack can be optimized out) */ /* Memzero helper (memset on stack can be optimized out) */
ATTR_NOINLINE ATTR_ZERO_REGS ATTR_NOINLINE ATTR_ZERO_REGS
void crypt_backend_memzero(void *s, size_t n) void crypt_backend_memzero(void *s, size_t n)