[openssl-commits] [openssl] master update

Emilia Kasper emilia at openssl.org
Mon Feb 22 17:31:14 UTC 2016


The branch master has been updated
       via  efc943be56df26ceac2504d57c4ecbe2bb113c97 (commit)
      from  a2d0baa2d931feae7f820d4594528894fd4a46cb (commit)


- Log -----------------------------------------------------------------
commit efc943be56df26ceac2504d57c4ecbe2bb113c97
Author: Emilia Kasper <emilia at openssl.org>
Date:   Mon Feb 22 16:58:36 2016 +0100

    MemorySanitizer: address false positive
    
    Explicitly unpoison the result of FD_ZERO
    
    Tests now pass, using -fsanitize=memory
    
    Reviewed-by: Rich Salz <rsalz at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 apps/s_client.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/apps/s_client.c b/apps/s_client.c
index 9d0b52a..b533780 100644
--- a/apps/s_client.c
+++ b/apps/s_client.c
@@ -173,6 +173,12 @@ typedef unsigned int u_int;
 # undef FIONBIO
 #endif
 
+#if defined(__has_feature)
+# if __has_feature(memory_sanitizer)
+#  include <sanitizer/msan_interface.h>
+# endif
+#endif
+
 #undef BUFSIZZ
 #define BUFSIZZ 1024*8
 #define S_CLIENT_IRC_READ_TIMEOUT 8
@@ -905,6 +911,16 @@ int s_client_main(int argc, char **argv)
     SRP_ARG srp_arg = { NULL, NULL, 0, 0, 0, 1024 };
 #endif
 
+    FD_ZERO(&readfds);
+    FD_ZERO(&writefds);
+/* Known false-positive of MemorySanitizer. */
+#if defined(__has_feature)
+# if __has_feature(memory_sanitizer)
+    __msan_unpoison(&readfds, sizeof(readfds));
+    __msan_unpoison(&writefds, sizeof(writefds));
+# endif
+#endif
+
     prog = opt_progname(argv[0]);
     c_quiet = 0;
     c_ign_eof = 0;


More information about the openssl-commits mailing list