diff options
author | 2007-07-11 04:50:43 +0000 | |
---|---|---|
committer | 2007-07-11 04:50:43 +0000 | |
commit | 3d70cd2b74eda86461921720b25e55adba6ea55e (patch) | |
tree | 440d9bb4b5f0581cabf5cffe79f9beb1f07ef2a6 | |
parent | do not put mt/eject onto small media; ok krw (diff) | |
download | wireguard-openbsd-3d70cd2b74eda86461921720b25e55adba6ea55e.tar.xz wireguard-openbsd-3d70cd2b74eda86461921720b25e55adba6ea55e.zip |
Do not divide by zero in DISKLABELV1_FFS_FSIZE if the argument value is bogus;
ok otto@ millert@ krw@
-rw-r--r-- | sys/sys/disklabel.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/sys/disklabel.h b/sys/sys/disklabel.h index a450b88bc82..58429e75c29 100644 --- a/sys/sys/disklabel.h +++ b/sys/sys/disklabel.h @@ -1,4 +1,4 @@ -/* $OpenBSD: disklabel.h,v 1.38 2007/06/20 18:15:47 deraadt Exp $ */ +/* $OpenBSD: disklabel.h,v 1.39 2007/07/11 04:50:43 miod Exp $ */ /* $NetBSD: disklabel.h,v 1.41 1996/05/10 23:07:37 mark Exp $ */ /* @@ -203,7 +203,7 @@ struct __partitionv0 { /* the partition table */ #define DISKLABELV1_FFS_BSIZE(i) ((i) == 0 ? 0 : (1 << (((i) >> 3) + 12))) #define DISKLABELV1_FFS_FRAG(i) ((i) == 0 ? 0 : (1 << (((i) & 0x07) - 1))) -#define DISKLABELV1_FFS_FSIZE(i) ((i) == 0 ? 0 : \ +#define DISKLABELV1_FFS_FSIZE(i) (DISKLABELV1_FFS_FRAG(i) == 0 ? 0 : \ (DISKLABELV1_FFS_BSIZE(i) / DISKLABELV1_FFS_FRAG(i))) #define DL_GETPSIZE(p) (((u_int64_t)(p)->p_sizeh << 32) + (p)->p_size) |