diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2003-04-06 03:02:45 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2003-04-06 03:02:45 +0000 |
commit | 8fea19bc2c0fc1c5cf2c6e45177ffd1ca7c92517 (patch) | |
tree | 1c9542a2e075429f5f803751b5ce426c9b5486f5 /sys/arch/vax/mba/hp.c | |
parent | 3d0f8ae22e810aef00073168f02cfe53c32996e8 (diff) |
The disklabel fields d_packname and d_typename are not null terminated strings
and should not be created or used as such.
This fixes some instances of both behaviours, and sets the stage for some
strcpy -> strncpy fixup.
ok tdeval@ millert@ deraadt@
Diffstat (limited to 'sys/arch/vax/mba/hp.c')
-rw-r--r-- | sys/arch/vax/mba/hp.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/vax/mba/hp.c b/sys/arch/vax/mba/hp.c index d395379dbbc..e663a33dcbb 100644 --- a/sys/arch/vax/mba/hp.c +++ b/sys/arch/vax/mba/hp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hp.c,v 1.12 2002/06/08 08:50:26 art Exp $ */ +/* $OpenBSD: hp.c,v 1.13 2003/04/06 03:02:44 krw Exp $ */ /* $NetBSD: hp.c,v 1.22 2000/02/12 16:09:33 ragge Exp $ */ /* * Copyright (c) 1996 Ludd, University of Lule}, Sweden. @@ -165,7 +165,8 @@ hpattach(parent, self, aux) if ((msg = readdisklabel(makedev(0, self->dv_unit * 8), hpstrategy, dl, NULL)) != NULL) printf(": %s", msg); - printf(": %s, size = %d sectors\n", dl->d_typename, dl->d_secperunit); + printf(": %.*s, size = %d sectors\n", + (int)sizeof(dl->d_typename), dl->d_typename, dl->d_secperunit); /* * check if this was what we booted from. */ |