From a4c24c66bc648938aa8bba409ca73ca0b43386e8 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Thu, 12 May 2005 20:04:48 +0000 Subject: [PATCH] Actually use the iterating variable in the for loop when trying to avoid overflow. Reported by: Vladislav Shabanov vs at rambler-co dot ru MFC after: 1 week Glanced at: alfred --- sys/kern/sysv_shm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/sysv_shm.c b/sys/kern/sysv_shm.c index b2059991ebed..02f96e60c6ae 100644 --- a/sys/kern/sysv_shm.c +++ b/sys/kern/sysv_shm.c @@ -957,7 +957,7 @@ shminit() TUNABLE_INT_FETCH("kern.ipc.shmmaxpgs", &shminfo.shmall); for (i = PAGE_SIZE; i > 0; i--) { - shminfo.shmmax = shminfo.shmall * PAGE_SIZE; + shminfo.shmmax = shminfo.shmall * i; if (shminfo.shmmax >= shminfo.shmall) break; }