=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/kdump/ktrstruct.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- src/usr.bin/kdump/ktrstruct.c 2015/10/09 01:37:08 1.12 +++ src/usr.bin/kdump/ktrstruct.c 2015/10/18 05:03:22 1.13 @@ -1,4 +1,4 @@ -/* $OpenBSD: ktrstruct.c,v 1.12 2015/10/09 01:37:08 deraadt Exp $ */ +/* $OpenBSD: ktrstruct.c,v 1.13 2015/10/18 05:03:22 guenther Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -117,13 +118,12 @@ struct sockaddr_un *sa_un; sa_un = (struct sockaddr_un *)sa; - if (sa_un->sun_len <= sizeof(sa_un->sun_len) + - sizeof(sa_un->sun_family)) { + if (sa_un->sun_len <= offsetof(struct sockaddr_un, sun_path)) { printf("invalid"); break; } printf("\"%.*s\"", (int)(sa_un->sun_len - - sizeof(sa_un->sun_len) - sizeof(sa_un->sun_family)), + offsetof(struct sockaddr_un, sun_path)), sa_un->sun_path); break; }