summaryrefslogtreecommitdiff
path: root/sbin/isakmpd
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2004-03-29 16:32:48 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2004-03-29 16:32:48 +0000
commit102c179e900fd62a574f22b2c99eef03d7fc70d3 (patch)
treead661fd036cc268077170345ddb52288edbab33e /sbin/isakmpd
parent858c35a6ed1fc66abf85b5c5a5d555965604582b (diff)
wrong FD_ZERO(); from ho, hshoexer, markus
Diffstat (limited to 'sbin/isakmpd')
-rw-r--r--sbin/isakmpd/monitor.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/isakmpd/monitor.c b/sbin/isakmpd/monitor.c
index e0fffa6c8a0..f6e9e67f0c7 100644
--- a/sbin/isakmpd/monitor.c
+++ b/sbin/isakmpd/monitor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monitor.c,v 1.14 2004/03/23 18:20:03 hshoexer Exp $ */
+/* $OpenBSD: monitor.c,v 1.15 2004/03/29 16:32:47 deraadt Exp $ */
/*
* Copyright (c) 2003 Håkan Olsson. All rights reserved.
@@ -539,6 +539,7 @@ monitor_loop (int debugging)
{
pid_t pid;
fd_set *fds;
+ size_t fdsn;
int n, maxfd;
if (!debugging)
@@ -546,7 +547,8 @@ monitor_loop (int debugging)
maxfd = m_state.s + 1;
- fds = (fd_set *)calloc (howmany (maxfd, NFDBITS), sizeof (fd_mask));
+ fdsn = howmany (maxfd, NFDBITS) * sizeof (fd_mask);
+ fds = (fd_set *)calloc (fdsn);
if (!fds)
{
kill (m_state.pid, SIGTERM);
@@ -594,7 +596,7 @@ monitor_loop (int debugging)
monitor_sighupped = 0;
}
- FD_ZERO (fds);
+ memset (fds, 0, fdsn);
FD_SET (m_state.s, fds);
n = select (maxfd, fds, NULL, NULL, NULL);