Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4283172

Browse files
committed
Prevent recursion during parse of email-like string with multiple '@'.
Patch by Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
1 parent b0c68c2 commit 4283172

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/backend/tsearch/wparser_def.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.21 2009/03/02 15:10:09 teodor Exp $
10+
* $PostgreSQL: pgsql/src/backend/tsearch/wparser_def.c,v 1.22 2009/03/10 17:32:14 teodor Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -620,6 +620,8 @@ p_ishost(TParser *prs)
620620
TParser *tmpprs = TParserInit(prs->str + prs->state->posbyte, prs->lenstr - prs->state->posbyte);
621621
int res = 0;
622622

623+
tmpprs->wanthost = true;
624+
623625
if (TParserGet(tmpprs) && tmpprs->type == HOST)
624626
{
625627
prs->state->posbyte += tmpprs->lenbytetoken;
@@ -1070,6 +1072,7 @@ static const TParserStateActionItem actionTPS_InHost[] = {
10701072
};
10711073

10721074
static const TParserStateActionItem actionTPS_InEmail[] = {
1075+
{p_isstophost, 0, A_POP, TPS_Null, 0, NULL},
10731076
{p_ishost, 0, A_BINGO | A_CLRALL, TPS_Base, EMAIL, NULL},
10741077
{NULL, 0, A_POP, TPS_Null, 0, NULL}
10751078
};

0 commit comments

Comments
 (0)