aboutsummaryrefslogtreecommitdiff
path: root/nc.c
diff options
context:
space:
mode:
authorkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-15 03:05:39 +0000
committerkraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-15 03:05:39 +0000
commitc74efb2e987da5ddd74112a71287f54008bf35b2 (patch)
tree5ef3cd183275014e52162978a2e49016cd72e0ac /nc.c
parented58a5f685dc13e2f920b178704b0b606a44bd27 (diff)
downloadbusybox-w32-c74efb2e987da5ddd74112a71287f54008bf35b2.tar.gz
busybox-w32-c74efb2e987da5ddd74112a71287f54008bf35b2.tar.bz2
busybox-w32-c74efb2e987da5ddd74112a71287f54008bf35b2.zip
Fix incorrect length passed to accept noted by Larry Doolittle.
git-svn-id: svn://busybox.net/trunk/busybox@2643 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'nc.c')
-rw-r--r--nc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nc.c b/nc.c
index 72439dd85..b58bd6a12 100644
--- a/nc.c
+++ b/nc.c
@@ -80,10 +80,12 @@ int nc_main(int argc, char **argv)
80 } 80 }
81 81
82 if (do_listen) { 82 if (do_listen) {
83 socklen_t addrlen = sizeof(address);
84
83 if (listen(sfd, 1) < 0) 85 if (listen(sfd, 1) < 0)
84 perror_msg_and_die("listen"); 86 perror_msg_and_die("listen");
85 87
86 if ((tmpfd = accept(sfd, (struct sockaddr *) &address, &opt)) < 0) 88 if ((tmpfd = accept(sfd, (struct sockaddr *) &address, &addrlen)) < 0)
87 perror_msg_and_die("accept"); 89 perror_msg_and_die("accept");
88 90
89 close(sfd); 91 close(sfd);