pgsql: Fix several bugs in tsvectorin, including crash due to - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix several bugs in tsvectorin, including crash due to
Date
Msg-id 20071023005123.AEF5B754229@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix several bugs in tsvectorin, including crash due to uninitialized field and
miscomputation of required palloc size.  The crash could only occur if the
input contained lexemes both with and without positions, which is probably not
common in practice.  The miscomputation would definitely result in wasted
space.  Also fix some inconsistent coding around alignment of strings and
positions in a tsvector value; these errors could also lead to crashes given
mixed with/without position data and a machine that's picky about alignment.
And be more careful about checking for overflow of string offsets.

Patch is only against HEAD --- I have not looked to see if same bugs are
in back-branch contrib/tsearch2 code.

Modified Files:
--------------
    pgsql/src/backend/tsearch:
        to_tsany.c (r1.4 -> r1.5)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/tsearch/to_tsany.c?r1=1.4&r2=1.5)
    pgsql/src/backend/utils/adt:
        tsvector.c (r1.5 -> r1.6)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/tsvector.c?r1=1.5&r2=1.6)
        tsvector_op.c (r1.5 -> r1.6)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/tsvector_op.c?r1=1.5&r2=1.6)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Clarify example of planner cost computation, per a suggestion
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix two-argument form of ts_rewrite() so it actually works for