diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2000-02-03 15:32:24 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 2000-02-03 15:32:24 +0000 |
commit | d7d5cc9c1570706b239570b7dc5e42d4ac457b97 (patch) | |
tree | 9796d9178a102d926cf2d758f48db1513fb82321 /sys/arch | |
parent | 141c4302c0a1395ca30c941aaaea370029297862 (diff) |
Prevent overflow in computation of buffer cache limitation
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/i386/i386/machdep.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index b4aee4f3661..5990d58e530 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.122 2000/01/29 21:41:49 mickey Exp $ */ +/* $OpenBSD: machdep.c,v 1.123 2000/02/03 15:32:23 niklas Exp $ */ /* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */ /*- @@ -503,8 +503,8 @@ allocsys(v) } /* Restrict to at most 70% filled kvm */ - if (nbuf * MAXBSIZE > - (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) * 7 / 10) + if (nbuf > + (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / MAXBSIZE * 7 / 10) nbuf = (VM_MAX_KERNEL_ADDRESS-VM_MIN_KERNEL_ADDRESS) / MAXBSIZE * 7 / 10; |