Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/usr.bin/netstat Pull up following revision(s) (requested ...
details: https://anonhg.NetBSD.org/src/rev/cceeb93bb44b
branches: netbsd-6
changeset: 776895:cceeb93bb44b
user: martin <martin%NetBSD.org@localhost>
date: Wed Feb 11 14:04:19 2015 +0000
description:
Pull up following revision(s) (requested by christos in ticket #1249):
usr.bin/netstat/inet.c: revision 1.106
usr.bin/netstat/inet6.c: revision 1.68
Allocate the right size for pcb blocks.
diffstat:
usr.bin/netstat/inet.c | 10 ++++++----
usr.bin/netstat/inet6.c | 10 ++++++----
2 files changed, 12 insertions(+), 8 deletions(-)
diffs (76 lines):
diff -r f19b4de400bf -r cceeb93bb44b usr.bin/netstat/inet.c
--- a/usr.bin/netstat/inet.c Wed Feb 04 11:38:31 2015 +0000
+++ b/usr.bin/netstat/inet.c Wed Feb 11 14:04:19 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: inet.c,v 1.101.2.1 2013/07/29 06:11:02 msaitoh Exp $ */
+/* $NetBSD: inet.c,v 1.101.2.2 2015/02/11 14:04:19 martin Exp $ */
/*
* Copyright (c) 1983, 1988, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "from: @(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
-__RCSID("$NetBSD: inet.c,v 1.101.2.1 2013/07/29 06:11:02 msaitoh Exp $");
+__RCSID("$NetBSD: inet.c,v 1.101.2.2 2015/02/11 14:04:19 martin Exp $");
#endif
#endif /* not lint */
@@ -284,7 +284,7 @@
(struct inpcb *)&((struct inpcbtable *)off)->inpt_queue.cqh_first;
next = (struct inpcb *)table.inpt_queue.cqh_first;
- if ((pcblist = malloc(size)) == NULL)
+ if ((pcblist = malloc(size * sizeof(*pcblist))) == NULL)
err(1, "malloc");
i = 0;
@@ -319,7 +319,9 @@
pcblist[i].ki_tstate = tcpcb.t_state;
pcblist[i].ki_pflags = inpcb.inp_flags;
if (i++ == size) {
- struct kinfo_pcb *n = realloc(pcblist, size += 100);
+ size += 100;
+ struct kinfo_pcb *n = realloc(pcblist,
+ size * sizeof(*pcblist));
if (n == NULL)
err(1, "realloc");
pcblist = n;
diff -r f19b4de400bf -r cceeb93bb44b usr.bin/netstat/inet6.c
--- a/usr.bin/netstat/inet6.c Wed Feb 04 11:38:31 2015 +0000
+++ b/usr.bin/netstat/inet6.c Wed Feb 11 14:04:19 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: inet6.c,v 1.59.6.1 2013/07/29 06:11:02 msaitoh Exp $ */
+/* $NetBSD: inet6.c,v 1.59.6.2 2015/02/11 14:04:19 martin Exp $ */
/* BSDI inet.c,v 2.3 1995/10/24 02:19:29 prb Exp */
/*
@@ -64,7 +64,7 @@
#if 0
static char sccsid[] = "@(#)inet.c 8.4 (Berkeley) 4/20/94";
#else
-__RCSID("$NetBSD: inet6.c,v 1.59.6.1 2013/07/29 06:11:02 msaitoh Exp $");
+__RCSID("$NetBSD: inet6.c,v 1.59.6.2 2015/02/11 14:04:19 martin Exp $");
#endif
#endif /* not lint */
@@ -295,7 +295,7 @@
(struct in6pcb *)&((struct inpcbtable *)off)->inpt_queue.cqh_first;
next = (struct in6pcb *)table.inpt_queue.cqh_first;
- if ((pcblist = malloc(size)) == NULL)
+ if ((pcblist = malloc(size * sizeof(*pcblist))) == NULL)
err(1, "malloc");
i = 0;
@@ -334,7 +334,9 @@
memcpy(&pcblist[i].ki_d, &sin6, sizeof(sin6));
pcblist[i].ki_tstate = tcpcb.t_state;
if (i++ == size) {
- struct kinfo_pcb *n = realloc(pcblist, size += 100);
+ size += 100;
+ struct kinfo_pcb *n = realloc(pcblist,
+ size * sizeof(*pcblist));
if (n == NULL)
err(1, "realloc");
pcblist = n;
Home |
Main Index |
Thread Index |
Old Index