about summary refs log tree commit diff homepage
path: root/tools/klee-replay
diff options
context:
space:
mode:
authorMartin Nowack <m.nowack@imperial.ac.uk>2023-02-23 21:51:45 +0000
committerCristian Cadar <c.cadar@imperial.ac.uk>2023-03-17 22:38:16 +0000
commitdd492f8763f13312c17eb67af33e3e90217a30e1 (patch)
treed1d1bf7ffdf3f890a5d5c3c5b6b7214bf60da845 /tools/klee-replay
parent71dc423262a91c012d708afc8b2e3cc3abdf49c3 (diff)
downloadklee-dd492f8763f13312c17eb67af33e3e90217a30e1.tar.gz
[MemSan] Mark memory objects modified by syscalls as initialised
Diffstat (limited to 'tools/klee-replay')
-rw-r--r--tools/klee-replay/file-creator.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/klee-replay/file-creator.c b/tools/klee-replay/file-creator.c
index 497cf1c3..e103a39f 100644
--- a/tools/klee-replay/file-creator.c
+++ b/tools/klee-replay/file-creator.c
@@ -463,16 +463,31 @@ static void check_file(int index, exe_disk_file_t *dfile) {
   switch (index) {
   case __STDIN:
     strcpy(name, "stdin");
+#if defined(__has_feature)
+#if __has_feature(memory_sanitizer)
+    memset(&s, 0, sizeof(struct stat));
+#endif
+#endif
     res = fstat(0, &s);
     break;
   case __STDOUT:
     strcpy(name, "stdout");
+#if defined(__has_feature)
+#if __has_feature(memory_sanitizer)
+    memset(&s, 0, sizeof(struct stat));
+#endif
+#endif
     res = fstat(1, &s);
     break;
   default:
     name[0] = 'A' + index;
     name[1] = '\0';
     snprintf(fullname, sizeof(fullname), "%s/%s", replay_dir, name);
+#if defined(__has_feature)
+#if __has_feature(memory_sanitizer)
+    memset(&s, 0, sizeof(struct stat));
+#endif
+#endif
     res = stat(fullname, &s);
 
     break;