Обсуждение: pgsql: Fix several bugs in tsvectorin, including crash due to

Поиск
Список
Период
Сортировка

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

От
tgl@postgresql.org (Tom Lane)
Дата:
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)