diff options
Diffstat (limited to 'Python/bootstrap_hash.c')
-rw-r--r-- | Python/bootstrap_hash.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Python/bootstrap_hash.c b/Python/bootstrap_hash.c index 7b187f1887..1b8f9d904a 100644 --- a/Python/bootstrap_hash.c +++ b/Python/bootstrap_hash.c @@ -20,6 +20,10 @@ # endif #endif +#ifdef MEMORY_SANITIZER +# include <sanitizer/msan_interface.h> +#endif + #ifdef Py_DEBUG int _Py_HashSecret_Initialized = 0; #else @@ -143,6 +147,11 @@ py_getrandom(void *buffer, Py_ssize_t size, int blocking, int raise) else { n = syscall(SYS_getrandom, dest, n, flags); } +# ifdef MEMORY_SANITIZER + if (n > 0) { + __msan_unpoison(dest, n); + } +# endif #endif if (n < 0) { |