=================================================================== RCS file: /cvs/mandoc/Attic/mdoc_hash.c,v retrieving revision 1.6 retrieving revision 1.8 diff -u -p -r1.6 -r1.8 --- mandoc/Attic/mdoc_hash.c 2009/07/17 10:56:27 1.6 +++ mandoc/Attic/mdoc_hash.c 2009/07/20 20:49:22 1.8 @@ -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.8 2009/07/20 20:49:22 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -14,6 +14,8 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include + #include #include #include @@ -126,6 +128,9 @@ mdoc_hash_find(const void *arg, const char *tmp) ADJUST_MINOR(minor); ind = INDEX(major, minor); + + if (ind < 0 || ind >= 26 * 3 * 52) + return(MDOC_MAX); if (htab[ind]) { slot = htab[ind] - /* LINTED */