From: Teodor Sigaev Date: Tue, 10 Mar 2009 17:32:14 +0000 (+0000) Subject: Prevent recursion during parse of email-like string with multiple '@'. X-Git-Url: http://waps.l3s.uni-hannover.de/gitweb/?a=commitdiff_plain;h=3bb52b39f9430e7738dfcc629146fd6161df9ea5;p=users%2Fsimon%2Fpostgres.git Prevent recursion during parse of email-like string with multiple '@'. Patch by Heikki Linnakangas --- diff --git a/src/backend/tsearch/wparser_def.c b/src/backend/tsearch/wparser_def.c index ad98fa5722..74a8a61f34 100644 --- a/src/backend/tsearch/wparser_def.c +++ b/src/backend/tsearch/wparser_def.c @@ -620,6 +620,8 @@ p_ishost(TParser *prs) TParser *tmpprs = TParserInit(prs->str + prs->state->posbyte, prs->lenstr - prs->state->posbyte); int res = 0; + tmpprs->wanthost = true; + if (TParserGet(tmpprs) && tmpprs->type == HOST) { prs->state->posbyte += tmpprs->lenbytetoken; @@ -1070,6 +1072,7 @@ static const TParserStateActionItem actionTPS_InHost[] = { }; static const TParserStateActionItem actionTPS_InEmail[] = { + {p_isstophost, 0, A_POP, TPS_Null, 0, NULL}, {p_ishost, 0, A_BINGO | A_CLRALL, TPS_Base, EMAIL, NULL}, {NULL, 0, A_POP, TPS_Null, 0, NULL} };