Fix backend crash in parsing incorrect tsquery.
authorTeodor Sigaev <[email protected]>
Mon, 12 Feb 2007 14:19:26 +0000 (14:19 +0000)
committerTeodor Sigaev <[email protected]>
Mon, 12 Feb 2007 14:19:26 +0000 (14:19 +0000)
 Per report from Jon Rosebaugh <[email protected]>

contrib/tsearch2/query.c

index 458c55de2798b4a6e7f767a08dc14f4aa9769d9b..9c4ed370a6bff3f17cdb1cfeaace619737b5e3f6 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) == ':')