diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-06-07 00:28:18 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-06-07 00:28:18 +0000 |
commit | 2b983a94dd05ba0dcd4e7d0f929d8c333e8c4ff8 (patch) | |
tree | 487d5866d3971c6c771894919fbed7e18df24ad8 /sys/arch/vax | |
parent | 7e0751214480a4f7fe318bedcb4bf8e309a3148d (diff) |
More bounds_check_with_label homogenization. Fix a couple of typos while
there.
'so go to it!' deraadt@
Diffstat (limited to 'sys/arch/vax')
-rw-r--r-- | sys/arch/vax/vax/disksubr.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/vax/vax/disksubr.c b/sys/arch/vax/vax/disksubr.c index c6116937153..f7dd2ccea47 100644 --- a/sys/arch/vax/vax/disksubr.c +++ b/sys/arch/vax/vax/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.42 2007/06/06 16:42:07 deraadt Exp $ */ +/* $OpenBSD: disksubr.c,v 1.43 2007/06/07 00:28:17 krw Exp $ */ /* $NetBSD: disksubr.c,v 1.21 1999/06/30 18:48:06 ragge Exp $ */ /* @@ -75,7 +75,7 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp, /* if exactly at end of disk, return EOF. */ if (bp->b_blkno == maxsz) { bp->b_resid = bp->b_bcount; - return(0); + return (-1); } /* Otherwise, truncate request. */ sz = maxsz - bp->b_blkno; @@ -89,7 +89,8 @@ bounds_check_with_label(struct buf *bp, struct disklabel *lp, /* overwriting disk label ? */ if (bp->b_blkno + DL_GETPOFFSET(p) <= LABELSECTOR + labelsector && - (bp->b_flags & B_READ) == 0 && wlabel == 0) { + bp->b_blkno + blockpersec(DL_GETPOFFSET(p), lp) + sz > labelsector && + (bp->b_flags & B_READ) == 0 && !wlabel) { bp->b_error = EROFS; goto bad; } |