aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_hash.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-07-17 11:00:18 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-07-17 11:00:18 +0000
commit86751a0fee731e2d48093706a5a7cedceec25433 (patch)
treead63e9e2da7ba3ecc8c3df01398d0a2d696cbeba /mdoc_hash.c
parent72e26562c1fc079294e29413bc0fc473e7be3bef (diff)
downloadmandoc-86751a0fee731e2d48093706a5a7cedceec25433.tar.gz
mandoc-86751a0fee731e2d48093706a5a7cedceec25433.tar.zst
mandoc-86751a0fee731e2d48093706a5a7cedceec25433.zip
Fixed hash assertion.
Diffstat (limited to 'mdoc_hash.c')
-rw-r--r--mdoc_hash.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mdoc_hash.c b/mdoc_hash.c
index 0e14b235..c1558224 100644
--- a/mdoc_hash.c
+++ b/mdoc_hash.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_hash.c,v 1.6 2009/07/17 10:56:27 kristaps Exp $ */
+/* $Id: mdoc_hash.c,v 1.7 2009/07/17 11:00:18 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -127,6 +127,9 @@ mdoc_hash_find(const void *arg, const char *tmp)
ind = INDEX(major, minor);
+ if (ind < 0 || ind >= 26 * 3 * 52)
+ return(MDOC_MAX);
+
if (htab[ind]) {
slot = htab[ind] - /* LINTED */
(void *)mdoc_macros;