summaryrefslogtreecommitdiffhomepage
path: root/dbutil.h
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2018-03-06 21:51:51 +0800
committerMatt Johnston <matt@ucc.asn.au>2018-03-06 21:51:51 +0800
commita60725740b65be8679afe612f7fec2639ed0eab7 (patch)
tree6b8cb9b55c175452598bcfc11f8dbcd6d002b45b /dbutil.h
parent5d065258da487301f269e795694702b5349de69f (diff)
workaround memory sanitizer FD_ZERO false positives
Diffstat (limited to 'dbutil.h')
-rw-r--r--dbutil.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/dbutil.h b/dbutil.h
index 7d1c3e1..7cb9d68 100644
--- a/dbutil.h
+++ b/dbutil.h
@@ -88,4 +88,11 @@ char * expand_homedir_path(const char *inpath);
void fsync_parent_dir(const char* fn);
+#if DROPBEAR_MSAN
+/* FD_ZERO seems to leave some memory uninitialized. clear it to avoid false positives */
+#define DROPBEAR_FD_ZERO(fds) do { memset((fds), 0x0, sizeof(fd_set)); FD_ZERO(fds); } while(0)
+#else
+#define DROPBEAR_FD_ZERO(fds) FD_ZERO(fds)
+#endif
+
#endif /* DROPBEAR_DBUTIL_H_ */