From: Adam Dickmeiss Date: Wed, 11 Aug 2004 09:02:48 +0000 (+0000) Subject: Fix buffer overrun in CCL parser for proximity X-Git-Tag: YAZ.2.0.23~1 X-Git-Url: http://sru.miketaylor.org.uk/cgi-bin?a=commitdiff_plain;h=6e8a8f144dfc8225d07a56d6a7f18056cb18ee22;p=yaz-moved-to-github.git Fix buffer overrun in CCL parser for proximity --- diff --git a/src/cclfind.c b/src/cclfind.c index 7cad1ab..08a4f79 100644 --- a/src/cclfind.c +++ b/src/cclfind.c @@ -44,7 +44,7 @@ /* CCL find (to rpn conversion) * Europagate, 1995 * - * $Id: cclfind.c,v 1.1 2003-10-27 12:21:30 adam Exp $ + * $Id: cclfind.c,v 1.2 2004-08-11 09:02:48 adam Exp $ * * Old Europagate log: * @@ -837,7 +837,7 @@ static struct ccl_rpn_node *search_terms (CCL_parser cclp, /* ! word order specified */ /* % word order not specified */ p_prox = mk_node(CCL_RPN_TERM); - p_prox->u.t.term = (char *) xmalloc(cclp->look_token->len); + p_prox->u.t.term = (char *) xmalloc(1 + cclp->look_token->len); memcpy(p_prox->u.t.term, cclp->look_token->name, cclp->look_token->len); p_prox->u.t.term[cclp->look_token->len] = 0;