diff --git a/src/random.c b/src/random.c index 9688d35c..6f7ad2d1 100644 --- a/src/random.c +++ b/src/random.c @@ -16,6 +16,13 @@ #include #endif +#if defined(__has_feature) +# if __has_feature(memory_sanitizer) +# include +# define WITH_MSAN 1 +# endif +#endif + #include "fido.h" #if defined(_WIN32) @@ -45,6 +52,9 @@ int fido_get_random(void *buf, size_t len) { arc4random_buf(buf, len); +#ifdef WITH_MSAN + __msan_unpoison(buf, len); /* XXX */ +#endif return (0); } #elif defined(HAVE_GETRANDOM)