From: Adam Dickmeiss Date: Thu, 31 May 2012 13:07:34 +0000 (+0200) Subject: Dict: fix out-of-bounds for long terms X-Git-Tag: v2.0.52~2 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=f31b347624a0c696df1945e4f88725d1e01eb8f9;hp=1be7fc91bc717063333d5cf90a2fa5f618b06b18 Dict: fix out-of-bounds for long terms Only happened due to increased IT_MAX_WORD, so nobody would be affected by this problem before. --- diff --git a/dict/lookgrep.c b/dict/lookgrep.c index ebd54b7..f480029 100644 --- a/dict/lookgrep.c +++ b/dict/lookgrep.c @@ -412,7 +412,7 @@ int dict_lookup_grep(Dict dict, const char *pattern, int range, void *client, mc = mk_MatchContext(dfa, range); - Rj = (MatchWord *) xcalloc((MAX_LENGTH+1) * mc->n, sizeof(*Rj)); + Rj = (MatchWord *) xcalloc((MAX_LENGTH+2) * mc->fact, sizeof(*Rj)); set_bit (mc, Rj, 0, 0); for (d = 1; d<=mc->range; d++)