diff options
author | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-05-15 03:05:39 +0000 |
---|---|---|
committer | kraai <kraai@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2001-05-15 03:05:39 +0000 |
commit | c74efb2e987da5ddd74112a71287f54008bf35b2 (patch) | |
tree | 5ef3cd183275014e52162978a2e49016cd72e0ac /nc.c | |
parent | ed58a5f685dc13e2f920b178704b0b606a44bd27 (diff) | |
download | busybox-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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); |