From: Jeffrey Altman Date: Tue, 28 Feb 2006 23:27:54 +0000 (+0000) Subject: STABLE14-viced-panic-if-maxhosttables-exceeded-20060228 X-Git-Tag: openafs-stable-1_4_1-rc9~16 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=181c477a7e1ccb6f5234a90aebf81a7f0e180842;p=packages%2Fo%2Fopenafs.git STABLE14-viced-panic-if-maxhosttables-exceeded-20060228 Do not allow HTBlocks to allocate more blocks than will fit in hosttablesptrs. Doing so corrupts memory. Panic instead until we can get this fixed right. (cherry picked from commit 2c825a859033574b714c00d0e16ce06f126e1d6d) --- diff --git a/src/viced/host.c b/src/viced/host.c index 682297861..43c0eb5ba 100644 --- a/src/viced/host.c +++ b/src/viced/host.c @@ -198,6 +198,11 @@ GetHTBlock() register int i; static int index = 0; + if (HTBlocks == h_MAXHOSTTABLES) { + ViceLog(0, ("h_MAXHOSTTABLES reached\n")); + ShutDownAndCore(PANIC); + } + block = (struct HTBlock *)malloc(sizeof(struct HTBlock)); if (!block) { ViceLog(0, ("Failed malloc in GetHTBlock\n"));