pgsql: Improve pglz_decompress() so that it cannot clobber memory beyond - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Improve pglz_decompress() so that it cannot clobber memory beyond
Date
Msg-id 20080308010936.7B454753F32@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Improve pglz_decompress() so that it cannot clobber memory beyond the
available output buffer when presented with corrupt input.  Some testing
suggests that this slows the decompression loop about 1%, which seems an
acceptable price to pay for more robustness.  (Curiously, the penalty
seems to be *less* on not-very-compressible data, which I didn't expect
since the overhead per output byte ought to be more in the literal-bytes
path.)

Patch from Zdenek Kotala.  I fixed a corner case and did some renaming
of variables to make the routine more readable.

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        pg_lzcompress.c (r1.30 -> r1.31)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/pg_lzcompress.c?r1=1.30&r2=1.31)

pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: Re: pgsql: Fix memory arrangement of tsquery after removing stop words.
Next
From: adunstan@postgresql.org (Andrew Dunstan)
Date:
Subject: pgsql: Improve efficiency of attribute scanning in