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

contrib/tsearch2/query.c

index 28d1b1dc56d126207758962dc756b5065c9a3d27..2e501210274f125023aaefdb244d3a5012678229 100644 (file)
@@ -142,12 +142,14 @@ gettoken_query(QPRS_STATE * state, int4 *val, int4 *lenval, char **strval, int2
                {
                    (state->buf)++;
                    *val = (int4) '!';
+                   state->state = WAITOPERAND;
                    return OPR;
                }
                else if (*(state->buf) == '(')
                {
                    state->count++;
                    (state->buf)++;
+                   state->state = WAITOPERAND;
                    return OPEN;
                }
                else if (*(state->buf) == ':')