Fix crash of filter(tsvector)
authorTeodor Sigaev
Wed, 4 May 2016 14:58:08 +0000 (17:58 +0300)
committerTeodor Sigaev
Wed, 4 May 2016 14:58:08 +0000 (17:58 +0300)
Variable storing a position of lexeme, had a wrong type: char, it's
obviously not enough to store 2^14 possible positions.

Stas Kelvich

src/backend/utils/adt/tsvector_op.c

index 8298e38545b80101883e86ec557839118b391f0c..b138bf10ca124861a3d2ea740e88d80db08a38ab 100644 (file)
@@ -773,8 +773,8 @@ tsvector_filter(PG_FUNCTION_ARGS)
    bool       *nulls;
    int         nweigths;
    int         i, j;
-   char        mask = 0,
-               cur_pos = 0;
+   int         cur_pos = 0;
+   char        mask = 0;
 
    deconstruct_array(weights, CHAROID, 1, true, 'c',
                      &dweights, &nulls, &nweigths);