Skip to content

Commit 4465529

Browse files
committed
Fix backend crash in parsing incorrect tsquery.
Per report from Jon Rosebaugh <jon@inklesspen.com>
1 parent eb19144 commit 4465529

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

contrib/tsearch2/query.c

+2
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,14 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, int2
159159
(state->buf)++; /* can safely ++, t_iseq guarantee
160160
* that pg_mblen()==1 */
161161
*val = (int4) '!';
162+
state->state = WAITOPERAND;
162163
return OPR;
163164
}
164165
else if (t_iseq(state->buf, '('))
165166
{
166167
state->count++;
167168
(state->buf)++;
169+
state->state = WAITOPERAND;
168170
return OPEN;
169171
}
170172
else if (t_iseq(state->buf, ':'))

0 commit comments

Comments
 (0)