about summary refs log tree commit diff homepage
path: root/tools/ktest-randgen/ktest-randgen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/ktest-randgen/ktest-randgen.cpp')
-rw-r--r--tools/ktest-randgen/ktest-randgen.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/ktest-randgen/ktest-randgen.cpp b/tools/ktest-randgen/ktest-randgen.cpp
index 04cf53e6..9b7260eb 100644
--- a/tools/ktest-randgen/ktest-randgen.cpp
+++ b/tools/ktest-randgen/ktest-randgen.cpp
@@ -117,6 +117,11 @@ void create_stat(size_t size, struct stat *s) {
     free(filename);
     error_exit("%s:%d: Error writing %s\n", __FILE__, __LINE__, filename);
   }
+#if defined(__has_feature)
+#if __has_feature(memory_sanitizer)
+  memset(s, 0, sizeof(struct stat));
+#endif
+#endif
 
   fstat(fd, s);