diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2001-01-16 05:34:16 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2001-01-16 05:34:16 +0000 |
commit | 86370b96c590d4c80af75091f9238d13ab88f77f (patch) | |
tree | 8813cab48afa329317eebdc29eb0a814a733f89b /usr.sbin | |
parent | cb480112931ae5581d91fe7867b033a7f39384f3 (diff) |
bzero the sets before FD_SET'n them
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pppoe/client.c | 5 | ||||
-rw-r--r-- | usr.sbin/pppoe/server.c | 6 |
2 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/pppoe/client.c b/usr.sbin/pppoe/client.c index 8ccd2d01f7f..d0ed24ab813 100644 --- a/usr.sbin/pppoe/client.c +++ b/usr.sbin/pppoe/client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: client.c,v 1.7 2001/01/16 05:01:39 jason Exp $ */ +/* $OpenBSD: client.c,v 1.8 2001/01/16 05:34:15 jason Exp $ */ /* * Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net @@ -116,7 +116,7 @@ client_mode(bfd, sysname, srvname, myea) if (max > oldmax) { if (fdsp != NULL) free(fdsp); - fdsp = (fd_set *)calloc(howmany(max, NFDBITS), + fdsp = (fd_set *)malloc(howmany(max, NFDBITS) * sizeof(fd_mask)); if (fdsp == NULL) { r = -1; @@ -124,6 +124,7 @@ client_mode(bfd, sysname, srvname, myea) } max = oldmax; } + bzero(fdsp, howmany(max, NFDBITS) * sizeof(fd_mask)); if (pppfd >= 0) FD_SET(pppfd, fdsp); diff --git a/usr.sbin/pppoe/server.c b/usr.sbin/pppoe/server.c index 14aba8cc7da..e6c76348440 100644 --- a/usr.sbin/pppoe/server.c +++ b/usr.sbin/pppoe/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.3 2001/01/16 05:01:40 jason Exp $ */ +/* $OpenBSD: server.c,v 1.4 2001/01/16 05:34:15 jason Exp $ */ /* * Copyright (c) 2000 Network Security Technologies, Inc. http://www.netsec.net @@ -103,12 +103,14 @@ reselect: if (n > oldmax) { if (fdsp != NULL) free(fdsp); - fdsp = (fd_set *)calloc(howmany(n, NFDBITS), + fdsp = (fd_set *)malloc(howmany(n, NFDBITS) * sizeof(fd_mask)); if (fdsp == NULL) break; oldmax = n; } + bzero(fdsp, howmany(n, NFDBITS) * sizeof(fd_mask)); + FD_SET(bpffd, fdsp); LIST_FOREACH(ses, &session_master.sm_sessions, s_next) { if (ses->s_fd != -1) |