aboutsummaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorGravatar Matt Kraai <kraai@debian.org>2001-05-15 03:05:39 +0000
committerGravatar Matt Kraai <kraai@debian.org>2001-05-15 03:05:39 +0000
commitbe9f44a7dfb225f03b68ad9c94539528458c84ff (patch)
tree5ef3cd183275014e52162978a2e49016cd72e0ac /networking
parent336480fe6f6539a9b6f1649157db2243445e3334 (diff)
downloadbusybox-be9f44a7dfb225f03b68ad9c94539528458c84ff.tar.gz
busybox-be9f44a7dfb225f03b68ad9c94539528458c84ff.tar.bz2
Fix incorrect length passed to accept noted by Larry Doolittle.
Diffstat (limited to 'networking')
-rw-r--r--networking/nc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/networking/nc.c b/networking/nc.c
index 72439dd85..b58bd6a12 100644
--- a/networking/nc.c
+++ b/networking/nc.c
@@ -80,10 +80,12 @@ int nc_main(int argc, char **argv)
}
if (do_listen) {
+ socklen_t addrlen = sizeof(address);
+
if (listen(sfd, 1) < 0)
perror_msg_and_die("listen");
- if ((tmpfd = accept(sfd, (struct sockaddr *) &address, &opt)) < 0)
+ if ((tmpfd = accept(sfd, (struct sockaddr *) &address, &addrlen)) < 0)
perror_msg_and_die("accept");
close(sfd);