pgsql: Fix several bugs in tsvectorin, including crash due to

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix several bugs in tsvectorin, including crash due to
Date: 2007-10-23 00:51:23
Message-ID: 20071023005123.AEF5B754229@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2007-10-23 01:44:40 pgsql: Fix two-argument form of ts_rewrite() so it actually works for
Previous Message Tom Lane 2007-10-22 21:34:33 pgsql: Clarify example of planner cost computation, per a suggestion