diff options
author | Teodor Sigaev | 2009-03-10 17:44:44 +0000 |
---|---|---|
committer | Teodor Sigaev | 2009-03-10 17:44:44 +0000 |
commit | 9424b22b5e9c538f9c57cd03f0a16a560b18864b (patch) | |
tree | 54db0bf0eb886b38e21bae6b059ee00d8ce30eba | |
parent | 20bef2176d79d1ab2f26401cbd6a32b6286a7918 (diff) |
Prevent recursion during parse of email-like string with multiple '@'.
Patch by Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
-rw-r--r-- | contrib/tsearch2/wordparser/parser.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/tsearch2/wordparser/parser.c b/contrib/tsearch2/wordparser/parser.c index 19b2cfd228e..c1a60e10994 100644 --- a/contrib/tsearch2/wordparser/parser.c +++ b/contrib/tsearch2/wordparser/parser.c @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/contrib/tsearch2/wordparser/parser.c,v 1.11.2.3 2009/03/02 15:13:17 teodor Exp $ */ +/* $PostgreSQL: pgsql/contrib/tsearch2/wordparser/parser.c,v 1.11.2.4 2009/03/10 17:44:44 teodor Exp $ */ #include "postgres.h" @@ -370,6 +370,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->lenbytelexeme; @@ -801,6 +803,7 @@ static TParserStateActionItem actionTPS_InHost[] = { }; static 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} }; |