diff common-session.c @ 1596:60fceff95858

workaround memory sanitizer FD_ZERO false positives
author Matt Johnston <matt@ucc.asn.au>
date Tue, 06 Mar 2018 21:51:51 +0800
parents 399d8eb961b5
children aabde6f57fce
line wrap: on
line diff
--- a/common-session.c	Tue Mar 06 21:00:09 2018 +0800
+++ b/common-session.c	Tue Mar 06 21:51:51 2018 +0800
@@ -152,8 +152,9 @@
 
 		timeout.tv_sec = select_timeout();
 		timeout.tv_usec = 0;
-		FD_ZERO(&writefd);
-		FD_ZERO(&readfd);
+		DROPBEAR_FD_ZERO(&writefd);
+		DROPBEAR_FD_ZERO(&readfd);
+
 		dropbear_assert(ses.payload == NULL);
 
 		/* We get woken up when signal handlers write to this pipe.
@@ -204,8 +205,8 @@
 			 * want to iterate over channels etc for reading, to handle
 			 * server processes exiting etc. 
 			 * We don't want to read/write FDs. */
-			FD_ZERO(&writefd);
-			FD_ZERO(&readfd);
+			DROPBEAR_FD_ZERO(&writefd);
+			DROPBEAR_FD_ZERO(&readfd);
 		}
 		
 		/* We'll just empty out the pipe if required. We don't do
@@ -406,7 +407,7 @@
 		return -1;
 	}
 
-	FD_ZERO(&fds);
+	DROPBEAR_FD_ZERO(&fds);
 
 	/* select since it's a non-blocking fd */