summaryrefslogtreecommitdiffstats
path: root/src/plugins/kdb
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2010-11-03 16:43:49 +0000
committerGreg Hudson <ghudson@mit.edu>2010-11-03 16:43:49 +0000
commit602ae0d3ad698ef15b49d0a24b2cf1a7cb05bb35 (patch)
tree85c719259b34bf226685dacd358a1571b4d7b84d /src/plugins/kdb
parent4bbbb3a924c34cee15e51681ea76171edd1a7f09 (diff)
downloadkrb5-602ae0d3ad698ef15b49d0a24b2cf1a7cb05bb35.tar.gz
krb5-602ae0d3ad698ef15b49d0a24b2cf1a7cb05bb35.tar.xz
krb5-602ae0d3ad698ef15b49d0a24b2cf1a7cb05bb35.zip
Avoid running off the end of the spares array in db2's page_to_oaddr()
in unrealistically large databases. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@24507 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/plugins/kdb')
-rw-r--r--src/plugins/kdb/db2/libdb2/hash/hash_page.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/kdb/db2/libdb2/hash/hash_page.c b/src/plugins/kdb/db2/libdb2/hash/hash_page.c
index f27e7dd86a..5841e92b5f 100644
--- a/src/plugins/kdb/db2/libdb2/hash/hash_page.c
+++ b/src/plugins/kdb/db2/libdb2/hash/hash_page.c
@@ -1276,7 +1276,7 @@ page_to_oaddr(hashp, pgno)
* 3. return...
*/
pgno -= hashp->hdr.hdrpages;
- for (sp = 0; sp < NCACHED; sp++)
+ for (sp = 0; sp < NCACHED - 1; sp++)
if (POW2(sp) + hashp->hdr.spares[sp] < pgno &&
(POW2(sp + 1) + hashp->hdr.spares[sp + 1]) > pgno)
break;