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

Lines changed: 4 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy