Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/kdump don't limit sockets to sizeof(sizeof sockaddr_...
details: https://anonhg.NetBSD.org/src/rev/bb854c27ad74
branches: trunk
changeset: 769980:bb854c27ad74
user: christos <christos%NetBSD.org@localhost>
date: Wed Sep 28 16:28:27 2011 +0000
description:
don't limit sockets to sizeof(sizeof sockaddr_storage). We can create valid
sockaddr_un sockets that exceed that. Arguably either
sizeof(struct sockaddr_storage) should be amended, or we should disallow
unix domain sockaddrs that exceed that size.
diffstat:
usr.bin/kdump/kdump.c | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diffs (31 lines):
diff -r f6d352129dc1 -r bb854c27ad74 usr.bin/kdump/kdump.c
--- a/usr.bin/kdump/kdump.c Wed Sep 28 16:14:04 2011 +0000
+++ b/usr.bin/kdump/kdump.c Wed Sep 28 16:28:27 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kdump.c,v 1.114 2011/09/21 17:48:53 christos Exp $ */
+/* $NetBSD: kdump.c,v 1.115 2011/09/28 16:28:27 christos Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: kdump.c,v 1.114 2011/09/21 17:48:53 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.115 2011/09/28 16:28:27 christos Exp $");
#endif
#endif /* not lint */
@@ -1031,11 +1031,7 @@
ktruser_soname(const char *name, const void *buf, size_t len)
{
char fmt[512];
- struct sockaddr_storage ss;
-
- memset(&ss, 0, sizeof(ss));
- memcpy(&ss, buf, len);
- sockaddr_snprintf(fmt, sizeof(fmt), "%a", (struct sockaddr *)&ss);
+ sockaddr_snprintf(fmt, sizeof(fmt), "%a", buf);
printf("%.*s: [%s]\n", KTR_USER_MAXIDLEN, name, fmt);
}
Home |
Main Index |
Thread Index |
Old Index