OSDN Git Service

Fix backend crash in parsing incorrect tsquery.
authorTeodor Sigaev <teodor@sigaev.ru>
Mon, 12 Feb 2007 14:14:33 +0000 (14:14 +0000)
committerTeodor Sigaev <teodor@sigaev.ru>
Mon, 12 Feb 2007 14:14:33 +0000 (14:14 +0000)
Per report from Jon Rosebaugh <jon@inklesspen.com>

contrib/tsearch2/query.c

index 902ee22..ea8790d 100644 (file)
@@ -159,12 +159,14 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, int2
                                        (state->buf)++;         /* can safely ++, t_iseq guarantee
                                                                                 * that pg_mblen()==1 */
                                        *val = (int4) '!';
+                                       state->state = WAITOPERAND;
                                        return OPR;
                                }
                                else if (t_iseq(state->buf, '('))
                                {
                                        state->count++;
                                        (state->buf)++;
+                                       state->state = WAITOPERAND;
                                        return OPEN;
                                }
                                else if (t_iseq(state->buf, ':'))