about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2002-05-14 17:29:49 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2002-05-14 17:29:49 +0000
commit568d2e0aba8022ab5c04a486ecee4b4c0c0cb331 (patch)
tree12efc0ce5860cd28abfe1b8f6166948abfe4ebbc
parent757e68c5e7918eaa67ecc9d7a0e9c764d9e81a30 (diff)
downloadzsh-568d2e0aba8022ab5c04a486ecee4b4c0c0cb331.tar.gz
zsh-568d2e0aba8022ab5c04a486ecee4b4c0c0cb331.tar.xz
zsh-568d2e0aba8022ab5c04a486ecee4b4c0c0cb331.zip
17161: Src/Modules/tcp.c: length parameter to accept()
wasn't initialised, causing random failures.
-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);