about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/Modules/tcp.c1
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 71dd0f63a..e7b7ef225 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-05-14  Peter Stephenson  <pws@csr.com>
+
+	* 17161: Src/Modules/tcp.c: length parameter to accept() wasn't
+	initialised, causing random failures.
+
 2002-05-14  Sven Wischnowsky  <wischnow@zsh.org>
 
 	* 17148: Completion/Base/Utility/_arguments,
diff --git a/Src/Modules/tcp.c b/Src/Modules/tcp.c
index f4339e134..c70d5bf69 100644
--- a/Src/Modules/tcp.c
+++ b/Src/Modules/tcp.c
@@ -534,6 +534,7 @@ bin_ztcp(char *nam, char **args, char *ops, int func)
 	}
 	sess = zts_alloc(ZTCP_INBOUND);
 
+	len = sizeof(sess->peer.in);
 	if ((rfd = accept(lfd, (struct sockaddr *)&sess->peer.in, &len)) == -1)
 	{
 	    zwarnnam(nam, "could not accept connection: %e", NULL, errno);