Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin correct fd_set allocation. from deraadt
details: https://anonhg.NetBSD.org/src/rev/cfd81c9c3a52
branches: trunk
changeset: 502149:cfd81c9c3a52
user: itojun <itojun%NetBSD.org@localhost>
date: Fri Jan 12 18:53:20 2001 +0000
description:
correct fd_set allocation. from deraadt
diffstat:
usr.sbin/mtrace6/mtrace6.c | 4 ++--
usr.sbin/traceroute/traceroute.c | 6 +++---
usr.sbin/traceroute6/traceroute6.c | 6 +++---
3 files changed, 8 insertions(+), 8 deletions(-)
diffs (72 lines):
diff -r f36dcc0985f9 -r cfd81c9c3a52 usr.sbin/mtrace6/mtrace6.c
--- a/usr.sbin/mtrace6/mtrace6.c Fri Jan 12 18:50:57 2001 +0000
+++ b/usr.sbin/mtrace6/mtrace6.c Fri Jan 12 18:53:20 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mtrace6.c,v 1.5 2000/12/04 07:03:18 itojun Exp $ */
+/* $NetBSD: mtrace6.c,v 1.6 2001/01/12 18:53:20 itojun Exp $ */
/* $KAME: mtrace6.c,v 1.16 2000/12/04 06:45:34 itojun Exp $ */
/*
@@ -237,7 +237,7 @@
tv_wait.tv_sec = waittime;
tv_wait.tv_usec = 0;
- nfdsp = howmany(mldsoc + 1, NFDBITS);
+ nfdsp = howmany(mldsoc + 1, NFDBITS) * sizeof(fd_mask);
fdsp = malloc(nfdsp);
if (!fdsp)
err(1, "malloc");
diff -r f36dcc0985f9 -r cfd81c9c3a52 usr.sbin/traceroute/traceroute.c
--- a/usr.sbin/traceroute/traceroute.c Fri Jan 12 18:50:57 2001 +0000
+++ b/usr.sbin/traceroute/traceroute.c Fri Jan 12 18:53:20 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: traceroute.c,v 1.41 2000/10/07 06:53:41 itojun Exp $ */
+/* $NetBSD: traceroute.c,v 1.42 2001/01/12 18:53:21 itojun Exp $ */
/*
* Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997
@@ -29,7 +29,7 @@
#else
__COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1991, 1994, 1995, 1996, 1997\n\
The Regents of the University of California. All rights reserved.\n");
-__RCSID("$NetBSD: traceroute.c,v 1.41 2000/10/07 06:53:41 itojun Exp $");
+__RCSID("$NetBSD: traceroute.c,v 1.42 2001/01/12 18:53:21 itojun Exp $");
#endif
#endif
@@ -1012,7 +1012,7 @@
int fromlen = sizeof(*fromp);
int retval;
- nfds = howmany(sock + 1, NFDBITS);
+ nfds = howmany(sock + 1, NFDBITS) * sizeof(fd_mask);
if ((fdsp = malloc(nfds)) == NULL) {
Fprintf(stderr, "%s: malloc: %s\n", prog, strerror(errno));
exit(1);
diff -r f36dcc0985f9 -r cfd81c9c3a52 usr.sbin/traceroute6/traceroute6.c
--- a/usr.sbin/traceroute6/traceroute6.c Fri Jan 12 18:50:57 2001 +0000
+++ b/usr.sbin/traceroute6/traceroute6.c Fri Jan 12 18:53:20 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: traceroute6.c,v 1.15 2000/12/22 15:12:04 itojun Exp $ */
+/* $NetBSD: traceroute6.c,v 1.16 2001/01/12 18:53:21 itojun Exp $ */
/* $KAME: traceroute6.c,v 1.39 2000/12/22 15:11:05 itojun Exp $ */
/*
@@ -79,7 +79,7 @@
#else
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: traceroute6.c,v 1.15 2000/12/22 15:12:04 itojun Exp $");
+__RCSID("$NetBSD: traceroute6.c,v 1.16 2001/01/12 18:53:21 itojun Exp $");
#endif
#endif
@@ -932,7 +932,7 @@
struct timeval wait;
int cc = 0, fdsn;
- fdsn = howmany(sock+1, NFDBITS) * sizeof(fd_mask);
+ fdsn = howmany(sock + 1, NFDBITS) * sizeof(fd_mask);
if ((fdsp = (fd_set *)malloc(fdsn)) == NULL)
err(1, "malloc");
memset(fdsp, 0, fdsn);
Home |
Main Index |
Thread Index |
Old Index